Cause it complicates things. First, that wouldn't work. You'd have to change the existing waitpid to sleep. You'd end up with:
{ local $SIG{CHLD} = 'IGNORE'; ... launch child ... if (sleep(20)) { kill(KILL => $child_pid); # Wait for child to die before restoring $SIG{CHLD}. # Unlikely race condition. while (kill(0, $child_pid)) { sleep(1) or last; } } }
There are side-effects to using $SIG{CHLD} = 'IGNORE'.
In reply to Re^2: exec creating zombie processes
by ikegami
in thread exec creating zombie processes
by jaiieq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |