summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2018-01-18 17:11:15 +0100
committerAbigail <abigail@abigail.be>2018-01-18 18:30:41 +0100
commit523d71b314dc75bd212794cc8392eab8267ea744 (patch)
treeaf9674cab1b09d49407f5220121f0f38cbcebd04 /toke.c
parent408956da6c7e0cd9dd2443723d668230c6d6675a (diff)
downloadperl-523d71b314dc75bd212794cc8392eab8267ea744.tar.gz
Revert "make PerlIO handle FD_CLOEXEC"
This reverts commit 2cdf406af42834c46ef407517daab0734f7066fc. The reason for the revert is that with this commit, perl fails to compile on darwin (or at least, one some versions of it): ./miniperl -Ilib make_ext.pl lib/auto/DB_File/DB_File.bundle MAKE="/Applications/Xcode.app/Contents/Developer/usr/bin/make" LIBPERL_A=libperl.a LINKTYPE=dynamic Parsing config.in... Looks Good. dyld: lazy symbol binding failed: Symbol not found: _mkostemp Referenced from: /private/tmp/perl/cpan/DB_File/../../miniperl Expected in: flat namespace dyld: Symbol not found: _mkostemp Referenced from: /private/tmp/perl/cpan/DB_File/../../miniperl Expected in: flat namespace Unsuccessful Makefile.PL(cpan/DB_File): code=5 at make_ext.pl line 518. make: *** [lib/auto/DB_File/DB_File.bundle] Error 2
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index 6e2742742a..75249430f0 100644
--- a/toke.c
+++ b/toke.c
@@ -7669,6 +7669,11 @@ Perl_yylex(pTHX)
if (!GvIO(gv))
GvIOp(gv) = newIO();
IoIFP(GvIOp(gv)) = PL_rsfp;
+ {
+ const int fd = PerlIO_fileno(PL_rsfp);
+ if (fd >= 3)
+ setfd_cloexec(fd);
+ }
/* Mark this internal pseudo-handle as clean */
IoFLAGS(GvIOp(gv)) |= IOf_UNTAINT;
if ((PerlIO*)PL_rsfp == PerlIO_stdin())