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 /doio.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 'doio.c')
-rw-r--r-- | doio.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -663,9 +663,9 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw, } #if defined(HAS_FCNTL) && defined(F_SETFD) if (fd >= 0) { - const int save_errno = errno; + dSAVE_ERRNO; fcntl(fd,F_SETFD,fd > PL_maxsysfd); /* can change errno */ - errno = save_errno; + RESTORE_ERRNO; } #endif IoIFP(io) = fp; @@ -1014,14 +1014,14 @@ Perl_do_eof(pTHX_ GV *gv) { /* getc and ungetc can stomp on errno */ - const int saverrno = errno; + dSAVE_ERRNO; const int ch = PerlIO_getc(IoIFP(io)); if (ch != EOF) { (void)PerlIO_ungetc(IoIFP(io),ch); - errno = saverrno; + RESTORE_ERRNO; return FALSE; } - errno = saverrno; + RESTORE_ERRNO; } if (PerlIO_has_cntptr(IoIFP(io)) && PerlIO_canset_cnt(IoIFP(io))) { |