Skip to content

Commit

Permalink
util.c:my_pclose: Use NULL in PL_fdpid
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Father Chrysostomos committed Sep 5, 2013
1 parent 9090718 commit 4981938
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4981938

Please sign in to comment.