summaryrefslogtreecommitdiff
path: root/t/io/closepid.t
Commit message (Collapse)AuthorAgeFilesLines
* [perl #119893] avoid waiting on pid 0Tony Cook2013-10-171-0/+47
When a filehandle is cloned into a standard handle, do_openn() copies the pid from the original handle in PL_fdpid to the standard handle and zeroes the entry for the original handle, so when the original handle was closed Perl_my_pclose() would call wait4pid() with a pid of 0. With v5.19.3-614-gd4c0274 I modified wait4pid(), perl's waitpid/wait4() wrapper, to allow a pid of zero through to the actual system call when available. These combined so that following v5.19.3-614-gd4c0274 in some circumstances closing the original handle would block by calling waitpid(0, ...) or wait4(0, ...), which waits for any child process in the same process group to terminate. This commit changes Perl_my_pclose() to wait for the child only when the stored pid is positive.