Re: gtk and system

It's that whole parent child thing.  You have to reap the dead children
after killing them, or double-fork to eliminate the parent-child
relationship by dropping the middle child.

Leeman Strout
alaric portone com

On Tue, 10 Oct 2000, Matt Eisemann wrote:

> This may not be a gtk problem, but let me explain my problem.  I have an 
> GTK+ application which starts processes using fork and execle, which works 
> great.  I save the process id (pid) of that process .  Later on, a user 
> pushes a button called 'stop tasks' and when called it concatenates the 
> 'kill' command with the saved pid.  Below is some basic code.
> When I try to kill the processes I started the system command does not 
> return an error code but the process consistently goes into a <defunct> 
> mode instead of dying.  However, when I leave my GTK+ application, the 
> <defunct> process does die.  But why not immediately.  Is this a gtk 
> problem, or a UNIX limitation or is the fact that I started the processes 
> with the GTK application cause some sort of a parent - child relationship. 
>  Thanks ahead of time for your help.
> sprintf(process_id,"%d",tasks->task_list[row].process_id);
> strcpy(executable,"kill -9 ");
> strcat(executable,process_id);
>   system(process_id);
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org


Leeman Strout

Systems Engineer
ETC Support

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