Skip to content

Commit 4981938

Browse files
author
Father Chrysostomos
committed
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.
1 parent 9090718 commit 4981938

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2755,7 +2755,7 @@ Perl_my_pclose(pTHX_ PerlIO *ptr)
27552755
svp = av_fetch(PL_fdpid,fd,TRUE);
27562756
pid = (SvTYPE(*svp) == SVt_IV) ? SvIVX(*svp) : -1;
27572757
SvREFCNT_dec(*svp);
2758-
*svp = &PL_sv_undef;
2758+
*svp = NULL;
27592759
#ifdef OS2
27602760
if (pid == -1) { /* Opened by popen. */
27612761
return my_syspclose(ptr);

0 commit comments

Comments
 (0)