Skip to content

Commit dd2bcea

Browse files
can1357sylvestre
andauthored
timeout: return timed-out status after kill grace period (#11392)
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
1 parent dfc08b2 commit dd2bcea

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/uu/timeout/src/timeout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ fn wait_or_kill_process(
296296
});
297297
Ok(exit_code)
298298
} else {
299-
Ok(ExitStatus::TimeoutFailed.into())
299+
Ok(ExitStatus::CommandTimedOut.into())
300300
}
301301
}
302302
Ok(None) => {

tests/by-util/test_timeout.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ fn test_preserve_status() {
104104
}
105105
}
106106

107+
#[test]
108+
fn test_kill_after_preserves_timeout_exit_without_preserve_status() {
109+
new_ucmd!()
110+
.args(&["-k", "1", "1", "sleep", "10"])
111+
.fails_with_code(124)
112+
.no_output();
113+
}
107114
#[test]
108115
fn test_preserve_status_even_when_send_signal() {
109116
// When sending CONT signal, process doesn't get killed or stopped.

0 commit comments

Comments
 (0)