This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
131d45a
)
One more FD_CLOEXEC case, missed in 131d45a9.
author
Jarkko Hietaniemi
<jhi@iki.fi>
Wed, 26 Aug 2015 23:57:08 +0000
(19:57 -0400)
committer
Jarkko Hietaniemi
<jhi@iki.fi>
Wed, 26 Aug 2015 23:58:01 +0000
(19:58 -0400)
doio.c
patch
|
blob
|
blame
|
history
diff --git
a/doio.c
b/doio.c
index
1b1e951
..
d038986
100644
(file)
--- a/
doio.c
+++ b/
doio.c
@@
-771,12
+771,10
@@
S_openn_cleanup(pTHX_ GV *gv, IO *io, PerlIO *fp, char *mode, const char *oname,
PerlIO_clearerr(fp);
fd = PerlIO_fileno(fp);
}
PerlIO_clearerr(fp);
fd = PerlIO_fileno(fp);
}
-#if defined(HAS_FCNTL) && defined(F_SETFD)
- if (fd >= 0) {
- if (fcntl(fd, F_SETFD, fd > PL_maxsysfd) < 0) {
- PerlLIO_close(fd);
- goto say_false;
- }
+#if defined(HAS_FCNTL) && defined(F_SETFD) && defined(FD_CLOEXEC)
+ if (fd > PL_maxsysfd && fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
+ PerlLIO_close(fd);
+ goto say_false;
}
#endif
IoIFP(io) = fp;
}
#endif
IoIFP(io) = fp;