[966] in Athena Bugs

home help back first fref pref prev next nref lref last post

6.0C: bug in toehold

daemon@ATHENA.MIT.EDU (John Carr)
Sat Sep 17 22:20:26 1988

To: bugs@ATHENA.MIT.EDU
Date: Sat, 17 Sep 88 22:19:55 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>

After toehold exec()s the X server, it does a perror() to catch a failed
exec.  This will fail because stderr was closed before the exec.

 source/4.3/etc.athena/toehold.c

180      fclose(stderr);        /* this forces X to open it's own logfile */
         ...
184      execv(prog, xargv);
185      perror("executing X server");
         ...

It is possible to recover stderr by dup(2) before the exec, and dup() and 
fdopen() after (you have to save and restore errno to do this correctly).
Alternatively, X could me modified to add a flag to the X server to open
a logfile regardless of the state of stderr.

  --John Carr

home help back first fref pref prev next nref lref last post