Re: [AD] allegro_message under X |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Julien Cugnière wrote:
Also, I used fork/exec/wait as suggested by Stepan Roh. It should be simpler, faster and safer, all at once :-) The only thing is that I'm not too confident about my use of fork/exec/waitpid. It seems to work, but it might need better error checking; and I'm not too clear about the interaction with ressources that allegro might uses, such as signals.
I didn't try the code yet, but:If the child fails on the `execlp', you should use `_exit' instead of `exit'.
It looks like the message will be written twice if `waitpid' fails.Also, it's possibly better to pass the string to xmessage via a pipe instead of the command-line, although since you're not using `system' anymore, it's not as important.
Peter
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |