changeset 13782:52f469edf216

(x_connection_signal): Set an alarm around XNoOp call.
author Karl Heuer <kwzh@gnu.org>
date Thu, 21 Dec 1995 17:16:13 +0000
parents fc1cf507c51b
children 53a7a5ed6e3c
files src/xterm.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Thu Dec 21 17:15:31 1995 +0000
+++ b/src/xterm.c	Thu Dec 21 17:16:13 1995 +0000
@@ -4650,13 +4650,24 @@
 {
   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 <jec@murzim.ca.boeing.com>,
+	 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.  */