Re: [gtk-list] Killing zombie children :-)



On Wed, Jul 07, 1999 at 04:06:35PM -0400, Conrad Steenberg wrote:
> I have a gtk app that forks off a child process to handle some I/O, via
> pipes. While trying to make the arrangement more robust, the parent
> gets signalled when the child dies, and can successfully refork and
> continue. 
> 
> My problem is this: the original child hangs around as a zombie process.
> What should I do to prevent this? All pipes connected to the zombie child
> are closed upon the receipt of the SIGCHLD, and all events monitoring I/O
> from/to the child gets cancelled with gdk_input_remove().
> 
> Any more informed persons with a clue?

Here's one possible solution: have the parent store the pid of each
child, and when the child terminates, have the parent call waitpid()
for the terminating child.

regards,
--andy



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]