Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: (PR#8491) Re: Freeciv commit: kauf: A new connect dial
Home

[Freeciv-Dev] Re: (PR#8491) Re: Freeciv commit: kauf: A new connect dial

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8491) Re: Freeciv commit: kauf: A new connect dialog for the client. This allo...
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Mon, 12 Apr 2004 07:57:14 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8491 >

On Mon, Apr 12, 2004 at 02:40:25AM -0700, Raimar Falke wrote:
> > +    /* these won't return on success */ 
> > +    execvp("./ser", argv);
> > +    execvp("./server/civserver", argv);
> > +    execvp("civserver", argv);
> 
> > +    /* This line is only reached if civserver cannot be started, 
> > +     * so we kill the forked process.
> 
> > +     * Calling exit here is dangerous due to X11 problems (async replies) 
> > */
> > +    _exit(1);
> 
> We use exit in a lot of other places. Can someone provide further
> informations?

Ok the explanation goes like this: the client has registered atexit
handlers (freeciv and maybe also X11). These get overwritten if we
successful replace the process image with exec*. In the error case
however a call to exit() would still call the atexit handlers and this
isn't a good idea.

So the mentioning of the X11 problems is misleading. It is a general
problem.

So _exit is used. But _exit isn't the best choice since C99 contains
_Exit with the same semantics (don't call atexit handlers).

Vasco and Andreas helped here.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "I heard if you play the NT-4.0-CD backwards, you get a satanic message."
 "That's nothing, if you play it forward, it installs NT-4.0"




[Prev in Thread] Current Thread [Next in Thread]