Fix mistaken assumption in ProcessEnd::from(unix)

This commit is contained in:
Félix Saparelli 2021-10-28 01:03:54 +13:00
parent 745e3baa71
commit a12a83cea2
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
1 changed files with 0 additions and 6 deletions

View File

@ -170,18 +170,12 @@ impl From<ExitStatus> for ProcessEnd {
}
(Some(code), None) => match NonZeroI64::try_from(i64::from(code)) {
Ok(code) => Self::ExitError(code),
Err(_) if cfg!(debug_assertions) => {
unreachable!("exitstatus code cannot be zero?!")
}
Err(_) => Self::Success,
},
// TODO: once unix_process_wait_more lands, use stopped_signal() instead and clear the libc dep
(None, Some(signal)) if libc::WIFSTOPPED(-signal) => {
match NonZeroI32::try_from(libc::WSTOPSIG(-signal)) {
Ok(signal) => Self::ExitStop(signal),
Err(_) if cfg!(debug_assertions) => {
unreachable!("exitsignal code cannot be zero?!")
}
Err(_) => Self::Success,
}
}