]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tap/awk: handle exit statuses > 256 (seen on few korn shells)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 28 Sep 2011 14:05:06 +0000 (16:05 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 28 Sep 2011 14:05:44 +0000 (16:05 +0200)
Some Korn shells, when a child process die due to signal number
n, can leave in $? an exit status of 256+n instead of the more
standard 128+n.  Apparently, both behaviours are allowed by
POSIX, so be prepared to handle them both.
This change has been motivated by a testsuite failure on Debian
with the AT&T Korn Shell version 93u-1.

* lib/tap-driver.sh (get_test_exit_message): Handle the described
Korn Shell behaviour too.
($scriptversion): Update.

ChangeLog
lib/tap-driver.sh

index 4fb02f52de190f76d1e707bc64ab0222eaab462e..ad6e9d6fb969cf1a4bd9356864fab5e850af1572 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2011-09-28  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tap/awk: handle exit statuses > 256 (seen on few korn shells)
+       Some Korn shells, when a child process die due to signal number
+       n, can leave in $? an exit status of 256+n instead of the more
+       standard 128+n.  Apparently, both behaviours are allowed by
+       POSIX, so be prepared to handle them both.
+       This change has been motivated by a testsuite failure on Debian
+       with the AT&T Korn Shell version 93u-1.
+       * lib/tap-driver.sh (get_test_exit_message): Handle the described
+       Korn Shell behaviour too.
+       ($scriptversion): Update.
+
 2011-09-24  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        uninstall: "make uninstall" before "make install" works
index 44317d9de90fe202900f9decc7e8d676cfd65032..e30c8039cf9c7f74e1d159302619ee6893e43dfa 100755 (executable)
@@ -23,7 +23,7 @@
 # bugs to <bug-automake@gnu.org> or send patches to
 # <automake-patches@gnu.org>.
 
-scriptversion=2011-08-25.11; # UTC
+scriptversion=2011-09-28.14; # UTC
 
 # Make unconditional expansion of undefined variables an error.  This
 # helps a lot in preventing typo-related bugs.
@@ -440,7 +440,15 @@ function get_test_exit_message(status)
     exit_details = " (command not found?)"
   else if (status >= 128 && status <= 255)
     exit_details = sprintf(" (terminated by signal %d?)", status - 128)
-  else if (status >= 256)
+  else if (status > 256 && status <= 384)
+    # We used to report an "abnormal termination" here, but some Korn
+    # shells, when a child process die due to signal number n, can leave
+    # in $? an exit status of 256+n instead of the more standard 128+n.
+    # Apparently, both behaviours are allowed by POSIX (2008), so be
+    # prepared to handle them both.
+    exit_details = sprintf(" (terminated by signal %d?)", status - 256)
+  else
+    # Never seen in practice.
     exit_details = " (abnormal termination)"
   return sprintf("exited with status %d%s", status, exit_details)
 }