Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/uu/timeout/src/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down
Loading