summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-09-05 01:11:59 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-09-05 05:59:11 -0700
commit49819382e088a19bed610c193947430231d2761d (patch)
treea82ef397094eabfa671e7e90744c4b7a87ca5cca /util.c
parent9090718a57d0f7533af9b7c5d8eb89ee636fb661 (diff)
downloadperl-49819382e088a19bed610c193947430231d2761d.tar.gz
util.c:my_pclose: Use NULL in PL_fdpid
PL_fdpid is an AV, and as of ce0d59f AVs use NULL for nonexist- ent elements. Without using NULL for deleted elements of PL_fdpid, we end up with pipes appearing to be open after they have actually been closed. I don’t know how to write a test for this, but it makes Proc::ParallelLoop pass its tests.
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index a2c2513d9f..d2380b2b9c 100644
--- a/util.c
+++ b/util.c
@@ -2755,7 +2755,7 @@ Perl_my_pclose(pTHX_ PerlIO *ptr)
svp = av_fetch(PL_fdpid,fd,TRUE);
pid = (SvTYPE(*svp) == SVt_IV) ? SvIVX(*svp) : -1;
SvREFCNT_dec(*svp);
- *svp = &PL_sv_undef;
+ *svp = NULL;
#ifdef OS2
if (pid == -1) { /* Opened by popen. */
return my_syspclose(ptr);