From 8525b870d5caa0a04858aa436ad6949ec277fc0c Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Tue, 10 Jan 2012 10:01:29 +0100 Subject: [PATCH] tap/awk: avoid redirection issues with bash 3.2 and earlier Fixes automake bug#10465. * lib/tap-driver.sh: Add workaround for bash 3.2 and earlier, which sometimes does not properly set '$?' when failing to write redirected output of a compound command. See the Autoconf manual for more details. The workaround was pointed out by Eric Blake. --- lib/tap-driver.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/tap-driver.sh b/lib/tap-driver.sh index c0112983b..725e7798b 100755 --- a/lib/tap-driver.sh +++ b/lib/tap-driver.sh @@ -115,7 +115,10 @@ else init_colors='' fi -{ +# :; is there to work around a bug in bash 3.2 (and earlier) which +# does not always set '$?' properly on redirection failure. +# See the Autoconf manual for more details. +:;{ ( # Ignore common signals (in this subshell only!), to avoid potential # problems with Korn shells. Some Korn shells are known to propagate -- 2.47.2