timeout: display signal 0 as '0' instead of 'EXIT' in verbose mode (#10194)

This is done to match a change in GNU coreutils after v9.9
This commit is contained in:
Chris Dryden
2026-01-17 23:13:54 +01:00
committed by GitHub
parent c4985953f8
commit 9ea24d66b0
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -210,7 +210,11 @@ fn catch_sigterm() {
/// Report that a signal is being sent if the verbose flag is set.
fn report_if_verbose(signal: usize, cmd: &str, verbose: bool) {
if verbose {
let s = signal_name_by_value(signal).unwrap();
let s = if signal == 0 {
"0".to_string()
} else {
signal_name_by_value(signal).unwrap().to_string()
};
show_error!(
"{}",
translate!("timeout-verbose-sending-signal", "signal" => s, "command" => cmd.quote())
+1 -1
View File
@@ -58,7 +58,7 @@ fn test_verbose() {
new_ucmd!()
.args(&[verbose_flag, "-s0", "-k.1", ".1", "sleep", "1"])
.fails()
.stderr_only("timeout: sending signal EXIT to command 'sleep'\ntimeout: sending signal KILL to command 'sleep'\n");
.stderr_only("timeout: sending signal 0 to command 'sleep'\ntimeout: sending signal KILL to command 'sleep'\n");
}
}