diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2015-08-26 19:57:08 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2015-08-26 19:58:01 -0400 |
commit | 194e5090d23ea35a046eac37a5d4af6db452bb54 (patch) | |
tree | 83facca6ad1ba673cf82bc2cfd7c2b2609758c95 /doio.c | |
parent | 131d45a96c910d0fe46597ab156a35837879bf9c (diff) | |
download | perl-194e5090d23ea35a046eac37a5d4af6db452bb54.tar.gz |
One more FD_CLOEXEC case, missed in 131d45a9.
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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); } -#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; |