From: Craig A. Berry Date: Thu, 12 Nov 2009 23:55:00 +0000 (-0600) Subject: 1 is a magic number to C's exit() and Perl_my_exit(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=81693ff90925b7d196d1f339fa6f85555e38cab7;p=p5sagit%2Fp5-mst-13.2.git 1 is a magic number to C's exit() and Perl_my_exit(). Its real name is EXIT_FAILURE and it comes out of the wash somewhat differently on VMS than elsewhere. --- diff --git a/ext/XS-APItest/t/my_exit.t b/ext/XS-APItest/t/my_exit.t index 31c0a6b..6f7cd8f 100644 --- a/ext/XS-APItest/t/my_exit.t +++ b/ext/XS-APItest/t/my_exit.t @@ -18,7 +18,13 @@ PROG ok EXPECT fresh_perl_is($prog, $expect); -is($? >> 8, 1, "exit code plain my_exit"); + +# C's EXIT_FAILURE ends up as SS$_ABORT (decimal 44) on VMS, which gets +# shifted to 4. Perl_my_exit (unlike Perl_my_failure_exit) does not +# have access to the vmsish pragmas to modify that behavior. + +my $exit_failure = $^O eq 'VMS' ? 4 : 1; +is($? >> 8, $exit_failure, "exit code plain my_exit"); ($prog, $expect) = (<<'PROG', <<'EXPECT'); use XS::APItest; @@ -29,5 +35,5 @@ PROG ok EXPECT fresh_perl_is($prog, $expect); -is($? >> 8, 1, "exit code my_exit inside a call_sv with G_EVAL"); +is($? >> 8, $exit_failure, "exit code my_exit inside a call_sv with G_EVAL");