From: Karl Heuer Date: Thu, 21 Dec 1995 17:16:13 +0000 (+0000) Subject: (x_connection_signal): Set an alarm around XNoOp call. X-Git-Tag: emacs-19.34~2078 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=15ffd0b38e02a96250116e2f06c54ee685391031;p=emacs.git (x_connection_signal): Set an alarm around XNoOp call. --- diff --git a/src/xterm.c b/src/xterm.c index c2e1e56d76c..6002f9cecc7 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4650,13 +4650,24 @@ x_connection_signal (signalnum) /* If we don't have an argument, */ { x_connection_signal_dpyinfo = x_display_list; + stop_polling (); sigunblock (SIGPIPE); while (x_connection_signal_dpyinfo) { signal (SIGPIPE, x_connection_signal_1); - + signal (SIGALRM, x_connection_signal_1); + + /* According to Jim Campbell , + On Solaris 2.4, XNoOp can hang when the connection + has already died. Since XNoOp should not wait, + let's assume that if it hangs for 3 seconds + that means the connection is dead. + This is a kludge, but I don't see any other way that works. */ + alarm (3); XNoOp (x_connection_signal_dpyinfo->display); + alarm (0); + XSync (x_connection_signal_dpyinfo->display, False); /* Each time we get here, cycle through the displays now open. */