]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Port functions/shell test to Solaris 10
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 8 Oct 2019 22:28:10 +0000 (15:28 -0700)
committerPaul Smith <psmith@gnu.org>
Thu, 10 Oct 2019 22:31:50 +0000 (18:31 -0400)
* tests/scripts/functions/shell: Port exit-status calculation
to Solaris 10 with Perl 5.8.4.

tests/scripts/functions/shell

index 54514e832789371bc8cb12fd272cb6381393ce4c..59865293e6f2697d41d57fd16dd0c838ca596a5c 100644 (file)
@@ -69,7 +69,12 @@ all: ; @echo $(.SHELLSTATUS)
     }
     waitpid($pid, 0);
     # .SHELLSTATUS for a signal gives 128 + the signal number
-    my $ret = $? + 128;
+    my $ret = $?;
+    if ($ret > 255) {
+       # Solaris 10 perl 5.8.4 puts signal number + 128 into the high 8 bits.
+       $ret >>= 8;
+    }
+    $ret |= 128;
 
     run_make_test('.PHONY: all
 $(shell kill -2 $$$$)