[PATCH] Remove /usr/adm/Xnmsgs

Michal Suchanek hramrach at gmail.com
Wed Apr 4 09:38:53 PDT 2012


On 4 April 2012 18:21, Jon TURNEY <jon.turney at dronecode.org.uk> wrote:
> In OsInit(), we check if fd 2 is writeable, and if not, assume stderr has
> been closed, and open /usr/adm/X0msgs for writing, and dup it on to fd 2.
> Unfortunately, this happens after CreateWellknownSockets() has opened the
> listener sockets, and that may use fd 2
>
> Specifically, this can easily triggered by running the X server with stderr
> closed (e.g. 'X 2>&-')
>
> So, as it stands, this code could prevent us from listening on one of our
> well-known listener sockets, if it happened to get assigned fd 2
>
> Also, if a file fd shows as ready for reading (which apparently SuS requires),
> we will constantly try to accept a connection on it, which is always going to
> fail, leading to the process spinning.
>
> I can't see what purpose this code serves, we write log output to the logfile,
> I don't really see why we need to write it all to another file as well.  The
> code itself is unclear ('Never happens' vs. 'if run from init').

Are there possibly any adverse sideeffects of trying to write the
error messages to stderr when it is not present?

Also does not writing to stderr break clients connected through socket
that happens to get fd 2?

Thanks

Michal


More information about the xorg-devel mailing list