Is x server connection still valid?

Daniel Stone daniel at
Tue Jan 9 15:03:45 PST 2007

On Tue, Jan 09, 2007 at 04:26:56PM -0600, hugo vanwoerkom wrote:
> 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.
> 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?

There's no way to have the process not terminate when you use Xlib.
It's a shocking API.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <>

More information about the xorg mailing list