in reply to Re^4: Killing Forks
in thread Killing Forks
I meant you could replace the kill, with an exit, not that you could skip the existing call to exit. You've done this nicely.
The problem with the code which spawned many processes is that each child continued on to run the parent code, going on to wait for children and possibly start their own.
You pretty much always want a good solid, unconditional 'exit' in the child codepath after a fork, otherwise you have a case where the child can start running the parent code. (Sometimes this is what you want, of course).
|
|---|