diff options
author | Chip Salzenberg <chip@pobox.com> | 2008-11-26 15:01:41 -0800 |
---|---|---|
committer | Steve Hay <SteveHay@planit.com> | 2008-12-05 18:11:56 +0000 |
commit | 4ee3916907333148e2c880a1f5aeba348c349925 (patch) | |
tree | ba07e244427cccdd6ed01277665634498770058c /perlio.c | |
parent | 33839f2f0661d0502f129769a85cfcf904354d39 (diff) | |
download | perl-4ee3916907333148e2c880a1f5aeba348c349925.tar.gz |
standardize save/restore of errno & vaxc$errno
Message-ID: <20081127070141.GD17663@tytlal.topaz.cx>
p4raw-id: //depot/perl@35018
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -3131,8 +3131,8 @@ PerlIOStdio_close(pTHX_ PerlIO *f) const int fd = fileno(stdio); int invalidate = 0; IV result = 0; - int saveerr = 0; int dupfd = -1; + dSAVEDERRNO; #ifdef USE_ITHREADS dVAR; #endif @@ -3166,7 +3166,7 @@ PerlIOStdio_close(pTHX_ PerlIO *f) fileno slot of the FILE * */ result = PerlIO_flush(f); - saveerr = errno; + SAVE_ERRNO; invalidate = PerlIOStdio_invalidate_fileno(aTHX_ stdio); if (!invalidate) { #ifdef USE_ITHREADS @@ -3205,7 +3205,7 @@ PerlIOStdio_close(pTHX_ PerlIO *f) errno may NOT be expected EBADF */ if (invalidate && result != 0) { - errno = saveerr; + RESTORE_ERRNO; result = 0; } #ifdef SOCKS5_VERSION_NAME @@ -3367,9 +3367,9 @@ PerlIOStdio_flush(pTHX_ PerlIO *f) /* * Not writeable - sync by attempting a seek */ - const int err = errno; + dSAVE_ERRNO; if (PerlSIO_fseek(stdio, (Off_t) 0, SEEK_CUR) != 0) - errno = err; + RESTORE_ERRNO; #endif } return 0; |