Is x server connection still valid?

hugo vanwoerkom huugske at
Tue Jan 9 14:26:56 PST 2007

On 1/9/07, Daniel Stone <daniel at> wrote:
> On Tue, Jan 09, 2007 at 04:05:17PM -0600, hugo vanwoerkom wrote:
> > I hope this is the right place to ask this question:
> >
> > I have various displays and want to modify the LEDs of the keyboards
> > connected to them.
> >
> > In order to do that I XOpenDisplay and see if it is successful.
> >
> > If successful I use XChangeKeyboardControl.
> >
> > But how do I find out next time I use that function that the X server
> > connection is still valid?
> > The user may have logged off, causing a SIGPIPE fault in using the function.
> > Is there some way to find if the display structure actually still is
> > for an existing connection without getting into that SIGPIPE?
> Xlib's default behaviour is to just terminate your process (see
> XSetIOErrorHandler, I think it is), so you're pretty safe there.
> Cheers,
> Daniel

Daniel, I don't want to terminate the process. This is for a started
task that writes to all keyboard LEDs. You mean there is no way to
find out if the display structure that I use in
XChangeKeyboardControl is still safe to use?


More information about the xorg mailing list