mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
wait for child to stop after sending signal
This commit is contained in:
@@ -343,8 +343,15 @@ fn timeout(
|
||||
send_signal(process, signal, foreground);
|
||||
match kill_after {
|
||||
None => {
|
||||
let status = process.wait()?;
|
||||
if preserve_status {
|
||||
Err(ExitStatus::SignalSent(signal).into())
|
||||
if let Some(ec) = status.code() {
|
||||
Err(ec.into())
|
||||
} else if let Some(sc) = status.signal() {
|
||||
Err(ExitStatus::SignalSent(sc.try_into().unwrap()).into())
|
||||
} else {
|
||||
Err(ExitStatus::CommandTimedOut.into())
|
||||
}
|
||||
} else {
|
||||
Err(ExitStatus::CommandTimedOut.into())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user