From: Pádraig Brady Date: Fri, 1 Nov 2024 12:42:41 +0000 (+0000) Subject: doc: fix timeout --help for -p X-Git-Tag: v9.6~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69aaec486f1750df433ce0b6eb3163aab51df829;p=thirdparty%2Fcoreutils.git doc: fix timeout --help for -p * src/timeout.c (usage): Fix typo of period with comma. * tests/timeout/timeout.sh: Only test a single option variant, as tests/misc/usage_vs_getopt.sh suffices for basic option validation. --- diff --git a/src/timeout.c b/src/timeout.c index 0f1afb1191..5600ce4295 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -275,7 +275,7 @@ Start COMMAND, and kill it if still running after DURATION.\n\ this long after the initial signal was sent\n\ "), stdout); fputs (_("\ - -p. --preserve-status\n\ + -p, --preserve-status\n\ exit with the same status as COMMAND,\n\ even when the command times out\n\ "), stdout); diff --git a/tests/timeout/timeout.sh b/tests/timeout/timeout.sh index 31af249cda..882d1300d5 100755 --- a/tests/timeout/timeout.sh +++ b/tests/timeout/timeout.sh @@ -37,9 +37,7 @@ returns_ 124 timeout .1 sleep 10 || fail=1 # exit status propagation even on timeout # exit status should be 128+TERM -for opt in '-p' '--preserve-status'; do - returns_ 124 timeout $opt .1 sleep 10 && fail=1 -done +returns_ 124 timeout --preserve-status .1 sleep 10 && fail=1 # kill delay. Note once the initial timeout triggers, # the exit status will be 124 even if the command @@ -47,9 +45,7 @@ done # exit status should be 128+KILL returns_ 124 timeout -s0 -k1 .1 sleep 10 && fail=1 # Ensure a consistent exit status with --foreground -for opt in '-f' '--foreground'; do - returns_ 124 timeout $opt -s0 -k1 .1 sleep 10 && fail=1 -done +returns_ 124 timeout --foreground -s0 -k1 .1 sleep 10 && fail=1 # Ensure 'timeout' is immune to parent's SIGCHLD handler # Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh.