1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

timeout: return 125 on invalid time interval args

Exit with status 125 (indicating an error in `timeout` itself) when
the timeout duration is invalid or the "kill after" duration is
invalid.
This commit is contained in:
Jeffrey Finkelstein 2022-03-26 10:22:23 -04:00 committed by Sylvestre Ledru
parent 9a0ef9a81f
commit b34685f8a5
2 changed files with 18 additions and 4 deletions

View file

@ -16,6 +16,16 @@ fn test_invalid_time_interval() {
new_ucmd!()
.args(&["xyz", "sleep", "0"])
.fails()
.code_is(125)
.usage_error("invalid time interval 'xyz'");
}
#[test]
fn test_invalid_kill_after() {
new_ucmd!()
.args(&["-k", "xyz", "1", "sleep", "0"])
.fails()
.code_is(125)
.usage_error("invalid time interval 'xyz'");
}