From 69aaec486f1750df433ce0b6eb3163aab51df829 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Fri, 1 Nov 2024 12:42:41 +0000 Subject: [PATCH] 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. --- src/timeout.c | 2 +- tests/timeout/timeout.sh | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) 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. -- 2.47.2