}
BEGIN {
- # MacOS system() doesn't have good return value
- $numtests = ($^O eq 'VMS') ? 16 : ($^O eq 'MacOS') ? 0 : 17;
+ $numtests = ($^O eq 'VMS') ? 16 : 17;
}
if (eval 'require VMS::Feature') {
$vms_exit_mode = !(VMS::Feature::current("posix_exit"));
} else {
- my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} =~ /^[ET1]/i;
- my $posix_ex = $ENV{'PERL_VMS_POSIX_EXIT'} =~ /^[ET1]/i;
+ my $env_unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
+ my $env_posix_ex = $ENV{'PERL_VMS_POSIX_EXIT'} || '';
+ my $unix_rpt = $env_unix_rpt =~ /^[ET1]/i;
+ my $posix_ex = $env_posix_ex =~ /^[ET1]/i;
if (($unix_rpt || $posix_ex) ) {
$vms_exit_mode = 0;
} else {
my $native_success = 0;
$native_success = 1 if $^O eq 'VMS';
-if ($^O ne 'MacOS') {
my $exit, $exit_arg;
$exit = run('exit');
if (!$vms_exit_mode) {
my $posix_ok = eval { require POSIX; };
my $wait_macros_ok = defined &POSIX::WIFEXITED;
- eval { POSIX::WIFEXITED() };
+ eval { POSIX::WIFEXITED(${^CHILD_ERROR_NATIVE}) };
$wait_macros_ok = 0 if $@;
$exit = run('exit 42');
is( $exit >> 8, 42, 'Non-zero exit' );
$exit_arg = 42;
$exit = run("END { \$? = $exit_arg }");
-# On VMS, in the child process the actual exit status will be SS$_ABORT,
+# On VMS, in the child process the actual exit status will be SS$_ABORT,
# or 44, which is what you get from any non-zero value of $? except for
# 65535 that has been dePOSIXified by STATUS_UNIX_SET. If $? is set to
# 65535 internally when there is a VMS status code that is valid, and
$exit_arg = (44 & 7) if $vms_exit_mode;
is( $exit >> 8, $exit_arg, 'Changing $? in END block' );
-}