mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
tests: timeout: fix false failure with older bash
This was seen on Centos 7 at least with bash 4.2.46. * tests/timeout/timeout.sh: Ensure the shell doesn't incorrectly optimize itself away when there are traps in place. Reported by Bruno Haible.
This commit is contained in:
1 parent
9aeb2eeb0f
commit
c0146c7c60
1 file changed
+1
@@ -116,6 +116,7 @@ timeout -v .1 $SHELL -c '
|
||||
exec 2>/dev/null # ensure no "Terminated" message blocks the trap
|
||||
trap "echo 1 >term.seen" TERM
|
||||
yes # Fill the pipe
|
||||
: # Prevent shell exec optimization from discarding traps
|
||||
' 2>&1 |
|
||||
{ retry_delay_ file_seen .1 6 || touch term.missed; }
|
||||
test -e term.missed && fail=1
|
||||
|
||||
Reference in new issue
Block a user