summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-11-30 00:55:54 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-11-30 00:55:54 +0000
commita8710ca18eb34a984d0dfab8503448f77a53b379 (patch)
tree18010d3af3d1eb629602e4be665911bcbca76876 /doio.c
parent041b774345efbca4380b50a1282029ce2362c5a0 (diff)
downloadperl-a8710ca18eb34a984d0dfab8503448f77a53b379.tar.gz
integrate changes#2273,2274,2288,2291 from maint-5.004
p4raw-link: @2291 on //depot/maint-5.004/perl: 36172d59ade32f9612ebd260a0d831031e1a0ef5 p4raw-link: @2288 on //depot/maint-5.004/perl: 5e378d39c1df8bf189b5f95b1ca8535607fe6545 p4raw-link: @2274 on //depot/maint-5.004/perl: 826799b6e704a8976be7d84e25ef2a15f3805c8e p4raw-link: @2273 on //depot/maint-5.004/perl: 3254abb72b4207034d3aa9fbe6418925a5db9484 p4raw-id: //depot/perl@2406
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/doio.c b/doio.c
index f624dcaef3..c7c6455dcd 100644
--- a/doio.c
+++ b/doio.c
@@ -366,8 +366,12 @@ do_open(GV *gv, register char *name, I32 len, int as_raw, int rawmode, int rawpe
PerlIO_clearerr(fp);
}
#if defined(HAS_FCNTL) && defined(F_SETFD)
- fd = PerlIO_fileno(fp);
- fcntl(fd,F_SETFD,fd > PL_maxsysfd);
+ {
+ int save_errno = errno;
+ fd = PerlIO_fileno(fp);
+ fcntl(fd,F_SETFD,fd > PL_maxsysfd); /* can change errno */
+ errno = save_errno;
+ }
#endif
IoIFP(io) = fp;
if (writing) {