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.
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);