Hiltjo Posthuma writes:
- sigchld(0);
+ if (signal(SIGCHLD, SIG_IGN) == SIG_ERR)
+ die("can't ignore SIGCHLD:");
I didn't test it yet, so maybe I'm misremembering/misreading the patch, but I don't think this will work: SIG_IGN will ignore new children, but it won't clean up any which are already ready to reap. That's why you need careful ordering of SIG_IGN and waitpid().
