[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: off-topic: need help with fork and Xlib error
From:       Uwe Thiem <uwe () uwix ! alt ! na>
Date:       1999-06-02 16:08:49
[Download RAW message or body]

On Wed, 2 Jun 1999, Waldo Bastian wrote:

> Stefan van den Oord wrote:
> > 
> > On Tue, 01 Jun 1999, Waldo Bastian wrote:
> > > > The child process inherits the file descriptor, and parent and child
> > > > both write to the X server. So the poor server gets multiple requests
> > > > on the same pipe and this confuses him.
> > >
> > > Ah of course! The QMessageBox is launched from the other thread! I was
> > > thinking that somehow the "exit(1)" fiddled with the fd's which came to
> > > me as unlikely.
> > 
> > I'm sorry, but that cannot be it. Just this code gives the error as
> > well:
> > 
> > if ( fork() )
> > {
> >     /* child process */
> >     exit ( 1 );
> > }
> > 
> > I didn't call QMessageBox yet when I got the error...
> 
> Hm... That's weird.. In that case you should try to close filedescriptors 
> before you run the child.

Nope. The above exit(1) isn't executed in the child at all but in the
parent.   ;-)   Should be if ( !fork() ).

Uwe

-------------------------------------------------------------------------
Uwe Thiem                                        Tel: +264 - 061 - 244511
P.O.Box 30955                                    Fax: +264 - 061 - 244511
Windhoek                                         Email:   uwe@uwix.alt.na
Republic of Namibia                                           uwe@kde.org
                                                       http://www.kde.org
                  **********************************
         You can still escape from the GATES of hell: Use KDE!
-------------------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic