nanogui@linuxhacker.org

nanogui@linuxhacker.org


Subject: Re: silkscreen buttons, GrCloseWindows
From: Morten Rolland
Date: Wed, 15 Nov 2000 13:39:54 +0100

CCYau wrote:
> I have used the GrGetWMProperties call to obtained the wid and compare
>to the title it got, successfully close the corresponding windows, by
> GrCloseWindow(wid);  however, the process/window I have closed was
> remained in the process list as Z state.... How can I cleanly kill
> a sub-process using Gr Windows function?

The problem with a process in the Z state is that you need to use
the 'wait', 'waitpid' or similar to collect the process' exit value.
A process in the Z state only occupies a slot in the process table,
contining the exit code of the process.

Normally, the shell does this for you, but when you use 'fork' yourself,
you have to do 'wait' as well.  If the parent process is dead, it is
the 'init' process that performs the wait to clean up the process table
IIRC.

Regards,
Morten Rolland

nanogui@linuxhacker.org