File tree 1 file changed +21
-28
lines changed
1 file changed +21
-28
lines changed Original file line number Diff line number Diff line change @@ -142,37 +142,30 @@ class Process::Status
142
142
@exit_status & 0xC0000000 _u32 == 0 ? ExitReason ::Normal : ExitReason ::Unknown
143
143
end
144
144
{% elsif flag?(:unix ) && ! flag?(:wasm32 ) % }
145
- # define __WIFEXITED(status) (__WTERMSIG(status) == 0)
146
- if signal_code == 0
145
+ case exit_signal?
146
+ when Nil
147
147
ExitReason ::Normal
148
- elsif signal_exit?
149
- case Signal .from_value?(signal_code)
150
- when Nil
151
- ExitReason ::Signal
152
- when .abrt?, .kill?, .quit?
153
- ExitReason ::Aborted
154
- when .hup?
155
- ExitReason ::TerminalDisconnected
156
- when .term?
157
- ExitReason ::SessionEnded
158
- when .int?
159
- ExitReason ::Interrupted
160
- when .trap?
161
- ExitReason ::Breakpoint
162
- when .segv?
163
- ExitReason ::AccessViolation
164
- when .bus?
165
- ExitReason ::BadMemoryAccess
166
- when .ill?
167
- ExitReason ::BadInstruction
168
- when .fpe?
169
- ExitReason ::FloatException
170
- else
171
- ExitReason ::Signal
172
- end
148
+ when .abrt?, .kill?, .quit?
149
+ ExitReason ::Aborted
150
+ when .hup?
151
+ ExitReason ::TerminalDisconnected
152
+ when .term?
153
+ ExitReason ::SessionEnded
154
+ when .int?
155
+ ExitReason ::Interrupted
156
+ when .trap?
157
+ ExitReason ::Breakpoint
158
+ when .segv?
159
+ ExitReason ::AccessViolation
160
+ when .bus?
161
+ ExitReason ::BadMemoryAccess
162
+ when .ill?
163
+ ExitReason ::BadInstruction
164
+ when .fpe?
165
+ ExitReason ::FloatException
173
166
else
174
167
# TODO: stop / continue
175
- ExitReason ::Unknown
168
+ ExitReason ::Signal
176
169
end
177
170
{% else % }
178
171
raise NotImplementedError .new(" Process::Status#exit_reason" )
You can’t perform that action at this time.
0 commit comments