From: Craig A. Berry Date: Sun, 24 Mar 2002 16:17:52 +0000 (-0600) Subject: errno help for VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9543c6b6ce261f69605b716f50b00bf1f32241c0;p=p5sagit%2Fp5-mst-13.2.git errno help for VMS From: "Craig A. Berry" Message-Id: p4raw-id: //depot/perl@15477 --- diff --git a/ext/POSIX/t/posix.t b/ext/POSIX/t/posix.t index a4d3792..a5c57a7 100644 --- a/ext/POSIX/t/posix.t +++ b/ext/POSIX/t/posix.t @@ -178,10 +178,6 @@ try_strftime("Fri Mar 31 00:00:00 2000 091", 0,0,0, 31,2,100); my $foo = $!; my $errno = POSIX::errno(); - local $TODO; - $TODO = 'POSIX::errno() munged by autoloading on VMS' - if $Is_VMS && $test == 0; - # Force numeric context. is( $errno + 0, $foo + 0, 'autoloading and errno() mix' ); } diff --git a/vms/vms.c b/vms/vms.c index 4ae5541..c56147c 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -6706,8 +6706,10 @@ Perl_flex_stat(pTHX_ const char *fspec, Stat_t *statbufp) char fileified[NAM$C_MAXRSS+1]; char temp_fspec[NAM$C_MAXRSS+300]; int retval = -1; + int saved_errno, saved_vaxc_errno; if (!fspec) return retval; + saved_errno = errno; saved_vaxc_errno = vaxc$errno; strcpy(temp_fspec, fspec); if (statbufp == (Stat_t *) &PL_statcache) do_tovmsspec(temp_fspec,namecache,0); @@ -6758,6 +6760,8 @@ Perl_flex_stat(pTHX_ const char *fspec, Stat_t *statbufp) } # endif } + /* If we were successful, leave errno where we found it */ + if (retval == 0) { errno = saved_errno; vaxc$errno = saved_vaxc_errno; } return retval; } /* end of flex_stat() */