Is there a reason you are using WNOHANG? It seems like you could just use the blocking form of waitpid (unless I'm missing something).
Other than that this looks ok. The main reason I mentioned waiting on each individual pid was that this comes in handy if your parent actually did use something like system().
In reply to Re^3: $? is -1???
by bluto
in thread $? is -1???
by kscaldef
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |