[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with XOpenDisplay
- To: mcr@ccs.carleton.ca (Michael Richardson)
- Subject: Re: Problems with XOpenDisplay
- From: urs@cs.stanford.edu (Urs Hoelzle)
- Date: Wed, 25 Aug 93 10:10:56 PDT
- Cc: self-interest
- In-reply-to: Your message of Wed, 25 Aug 93 13:00:47 EDT
- Reply-to: urs@cs.stanford.edu
- Resent-date: Wed, 25 Aug 93 10:11:15 PDT
- Resent-from: Urs Hoelzle <urs@otis>
- Resent-message-id: <9308251711.AA28081@otis.Stanford.EDU>
- Resent-to: real-self-interest
- Sender: Urs Hoelzle <urs@otis>
Here's what our current VM does (in xlibPrims.c):
Display* XOpenDisplay_wrap(char *name, void *FH) {
// XOpenDisplay fails if a signal is received during the call.
// All signals except user interrupts are therefore blocked.
SignalBlocker sb(true);
Display* result = XOpenDisplay(name);
if (result == 0) {
prim_failure(FH, PRIMITIVEFAILEDERROR);
return result;
}
XSetErrorHandler(xErrorHandler);
XSetIOErrorHandler(xIOErrorHandler);
// add this file descriptor to list of all open files
FD_SET(ConnectionNumber(result), &activeFDs);
return result;
}
The SignalBlocker blocks all signals except user interrupts (see
abort.h) (yes, we're using SIGVTALARM and SIGIO as well).
This definitely improves things, but sometimes it still fails. Don't
ask me why.
-Urs