@@ -51,11 +51,15 @@ const WSTOPPED: WaitPidFlag = WUNTRACED;
51
51
pub enum WaitStatus {
52
52
/// Signifies that the process has exited, providing the PID and associated exit status.
53
53
Exited ( Pid , i8 ) ,
54
- /// Signifies that the process was killed by a signal, providing the PID and associated signal.
54
+ /// Signifies that the process was killed by a signal, providing the PID, the associated
55
+ /// signal, and a boolean value that is set to `true` when a core dump was produced.
55
56
Signaled ( Pid , Signal , bool ) ,
56
- /// Signifies that the process was stopped by a signal, providing the PID and associated signal.
57
+ /// Signifies that the process was stopped by a signal, providing the PID and associated
58
+ /// signal.
57
59
Stopped ( Pid , Signal ) ,
58
60
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
61
+ /// Signifies that the process was stopped due to a ptrace event, providing the PID, the
62
+ /// associated signal, and an integer that represents the status of the event.
59
63
PtraceEvent ( Pid , Signal , c_int ) ,
60
64
/// Signifies that the process received a `SIGCONT` signal, and thus continued.
61
65
Continued ( Pid ) ,
@@ -207,11 +211,12 @@ fn decode(pid : Pid, status: i32) -> WaitStatus {
207
211
cfg_if ! {
208
212
if #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ] {
209
213
fn decode_stopped( pid: Pid , status: i32 ) -> WaitStatus {
210
- let status_additional = status:: stop_additional( status) ;
211
- if status_additional == 0 {
212
- WaitStatus :: Stopped ( pid, status:: stop_signal( status) )
214
+ let status = status:: stop_additional( status) ;
215
+ let signal = status:: stop_signal( status) ;
216
+ if status == 0 {
217
+ WaitStatus :: Stopped ( pid, signal)
213
218
} else {
214
- WaitStatus :: PtraceEvent ( pid, status :: stop_signal ( status ) , status:: stop_additional ( status ) )
219
+ WaitStatus :: PtraceEvent ( pid, signal , status)
215
220
}
216
221
}
217
222
} else {
0 commit comments