Re: [gtk-list] Re: Proper way to fork() a GTK program (to exec() something)



Quite frankly, Hrvoje Niksic said:
| Paul Bunyk <paul@pbunyk.physics.sunysb.edu> writes:
| 
| > Are there any rules how should I do that? E.g., can I just use
| > exit() my child process (if something goes wrong before exec), or I
| > should use gtk_exit()?
| 
| As Lars explained, you definitely want to use _exit() in the child, so 
| that the atexit handlers don't run and screw up the parent.
| 
| Also, you probably cannot do what you intended to do, i.e. directly
| call gtk functions from the child process.  The pipe thing should
| work, though.

This poses a little problem:  What if a GTK application wants to execute
a program and, say, give the user some buttons to kill the program using
various signals?  That program very well might be using exit(), and thus
screw up your application.

If anybody else with more in-depth knowledge of how this works could
comment, please do!  The ability to run child processes from a GTK
application seems, in my opinion, a VERY important thing.

-- 
Eric ... Spirilis ... Zephimir ... (chaos? :)
       ______________________________
      /  erbrun@bellatlantic.net      \
      |  > hannibal@bitsmart.com <      \
       \    zephimir@bastion.cnsnet.net  |
         \_____________________________/
"Computer underwater due to SYN flooding."



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