Re: [gtk-list] Q: wait for child, process its return value




Nils Philippsen <nils@wombat.dialup.fht-esslingen.de> writes:

> Hello,
> 
> For a program I write (simple GUI for a UUCP feed, at the moment just a
> single button which will run sendmail -q, then uucico, then sendmail -q
> again) I need to do something like this:
> 
> wait on the child process, while processing gtk+ events (here wait() will
> not suffice) but after the child's death I need it's return value (and I
> don't want to know, when a child is SIGSTOPped), so signal(SIGCHLD, ...)
> won't suffice, too.
> 
> Has anybody a suggestion how to continue processing gtk+-events and having
> the subsequently called program's return value?

One simple approach is set up a SIGCHLD handler that just stores the
return value into a variable and sets a flag. Then, set up a GTK+
timeout with gtk_timeout_add() that checks that flag
occasionally. (Say, every 100ms).

Regards,
                                        Owen




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