in reply to Re^3: Protection from zombies
in thread Protection from zombies

Right. Moving the sleep after the close works too, since the close does a waitpid.