]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tap/awk: avoid redirection issues with bash 3.2 and earlier
authorPeter Rosin <peda@lysator.liu.se>
Tue, 10 Jan 2012 09:01:29 +0000 (10:01 +0100)
committerPeter Rosin <peda@lysator.liu.se>
Tue, 10 Jan 2012 09:01:29 +0000 (10:01 +0100)
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

index c0112983bc1f643406198ae5f452b8c52c094a88..725e7798bfe2ae10244ab48a92bc55cb90853fc0 100755 (executable)
@@ -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