|
I'm rewriting my post... It seems it got lost somehow.
Check the line while(--count). The "While" loop will exit when count is 1, as --count is evaluated to 0, so the child from childpids[0] isn't killed.
You can simply replace the "while" line with:
for(count-=1; count >= 0; count--)
Best regards!
|