summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@pobox.com>2008-11-26 15:01:41 -0800
committerSteve Hay <SteveHay@planit.com>2008-12-05 18:11:56 +0000
commit4ee3916907333148e2c880a1f5aeba348c349925 (patch)
treeba07e244427cccdd6ed01277665634498770058c /doio.c
parent33839f2f0661d0502f129769a85cfcf904354d39 (diff)
downloadperl-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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/doio.c b/doio.c
index 09170188ec..5b41a78a10 100644
--- a/doio.c
+++ b/doio.c
@@ -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))) {