]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tap/awk: account for unusual korn shell signal handling behaviour
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 28 Sep 2011 14:31:24 +0000 (16:31 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 28 Sep 2011 14:31:24 +0000 (16:31 +0200)
This change has been motivated by a testsuite failure on Debian
with the AT&T Korn Shell version 93u-1.

* lib/tap-driver.sh: Temporarily ignore some common signals when
waiting for the test command to complete, to avoid premature exit
in Korn shells that propagate to themselves signals that have
killed a child process.

See also related commit `v1.11-1342-g6321ad3'.

ChangeLog
lib/tap-driver.sh

index ad6e9d6fb969cf1a4bd9356864fab5e850af1572..a6779c5e152e725830afc1df66a6b60dbd4d0149 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-09-28  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tap/awk: account for unusual korn shell signal handling behaviour
+       This change has been motivated by a testsuite failure on Debian
+       with the AT&T Korn Shell version 93u-1.
+       * lib/tap-driver.sh: Temporarily ignore some common signals when
+       waiting for the test command to complete, to avoid premature exit
+       in Korn shells that propagate to themselves signals that have
+       killed a child process.
+       See also related commit `v1.11-1342-g6321ad3'.
+
 2011-09-28  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        tap/awk: handle exit statuses > 256 (seen on few korn shells)
index e30c8039cf9c7f74e1d159302619ee6893e43dfa..e9f103755fa80bb6877980c8025704422b8933d0 100755 (executable)
@@ -116,14 +116,27 @@ else
 fi
 
 {
-  { if test $merge -gt 0; then
+  (
+    # Ignore common signals (in this subshell only!) to avoid potential
+    # problems with Korn shells.  Some Korn shells are known to propagate
+    # to themselves signals that have killed a child process they were
+    # waiting for (this is done at least for SIGINT -- and usually only
+    # for it in truth); this would cause a premature exit in this subshell,
+    # so that the awk script would never seen the exit status it expects
+    # on its last input line (and which is displayed below by the last
+    # `echo $?' command), and would thus die reporting an internal error.
+    # For more information, see the Autoconf manual and the threads:
+    # <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
+    # <http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2009-February/004121.html>
+    trap : 1 3 2 13 15
+    if test $merge -gt 0; then
       exec 2>&1
     else
       exec 2>&3
     fi
     "$@"
     echo $?
-  } | LC_ALL=C ${AM_TAP_AWK-awk} \
+  ) | LC_ALL=C ${AM_TAP_AWK-awk} \
         -v me="$me" \
         -v test_script_name="$test_name" \
         -v log_file="$log_file" \