summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2009-11-12 17:55:00 -0600
committerCraig A. Berry <craigberry@mac.com>2009-11-12 17:55:00 -0600
commit81693ff90925b7d196d1f339fa6f85555e38cab7 (patch)
treec338c52bd6d804b69b90a84634746cc23d5a4c80 /ext
parent968682bce14e5963abd216113468bc07e01bce0f (diff)
downloadperl-81693ff90925b7d196d1f339fa6f85555e38cab7.tar.gz
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.
Diffstat (limited to 'ext')
-rw-r--r--ext/XS-APItest/t/my_exit.t10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/XS-APItest/t/my_exit.t b/ext/XS-APItest/t/my_exit.t
index 31c0a6b232..6f7cd8f5a8 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");