Mercurial > emacs
changeset 15514:3f3903d33cb9
(x_connection_signal): Just return after calling `signal'.
(X_CONNECTION_LOCK_FLAG): Definition deleted.
(x_connection_signal_dpyinfo): Variable deleted.
(x_connection_signal_1): Function deleted.
(x_connection_close_if_hung): Function deleted.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 26 Jun 1996 17:41:44 +0000 |
parents | 1252826f389b |
children | 69257ac25af4 |
files | src/xterm.c |
diffstat | 1 files changed, 8 insertions(+), 92 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xterm.c Tue Jun 25 22:44:10 1996 +0000 +++ b/src/xterm.c Wed Jun 26 17:41:44 1996 +0000 @@ -121,10 +121,6 @@ #include <string.h> #endif -#ifdef SOLARIS2 -#define X_CONNECTION_LOCK_FLAG XlibDisplayWriting -#endif - #ifndef min #define min(a,b) ((a)<(b) ? (a) : (b)) #endif @@ -4580,55 +4576,19 @@ /* Handle SIGPIPE, which can happen when the connection to a server simply goes away. SIGPIPE is handled by x_connection_signal. - It works by sending a no-op command to each X server connection. - When we try a connection that has closed, we get SIGPIPE again. - But this time, it is handled by x_connection_signal_1. - That function knows which connection we were testing, - so it closes that one. - - x_connection_closed never returns, - so if more than one connection was lost at once, - we only find one. But XTread_socket keeps trying them all, - so it will notice the other closed one sooner or later. */ + Don't need to do anything, because the write which caused the + SIGPIPE will fail, causing Xlib to invoke the X IO error handler, + which will do the appropriate cleanup for us. */ - -static struct x_display_info *x_connection_signal_dpyinfo; - -static SIGTYPE x_connection_signal (); - -static SIGTYPE -x_connection_signal_1 (signalnum) /* If we don't have an argument, */ - int signalnum; /* some compilers complain in signal calls. */ -{ - signal (SIGPIPE, x_connection_signal); - x_connection_closed (x_connection_signal_dpyinfo->display, - "connection was lost"); -} - static SIGTYPE x_connection_signal (signalnum) /* If we don't have an argument, */ int signalnum; /* some compilers complain in signal calls. */ { - x_connection_signal_dpyinfo = x_display_list; - - sigunblock (sigmask (SIGPIPE)); - - while (x_connection_signal_dpyinfo) - { - signal (SIGPIPE, x_connection_signal_1); - - x_connection_close_if_hung (x_connection_signal_dpyinfo); - - XNoOp (x_connection_signal_dpyinfo->display); - - XSync (x_connection_signal_dpyinfo->display, False); - - /* Each time we get here, cycle through the displays now open. */ - x_connection_signal_dpyinfo = x_connection_signal_dpyinfo->next; - } - - /* We should have found some closed connection. */ - abort (); +#ifdef USG + /* USG systems forget handlers when they are used; + must reestablish each time */ + signal (signalnum, x_connection_signal); +#endif /* USG */ } /* A buffer for storing X error messages. */ @@ -6244,49 +6204,5 @@ staticpro (&Qvendor_specific_keysyms); Qvendor_specific_keysyms = intern ("vendor-specific-keysyms"); } - -/* Avoid warnings or errors from including Xlibint.h. - We don't need these functions for the rest of this file. */ -#undef bzero -#undef bcopy -#undef bcmp -#undef min -#undef max - -#ifdef X_CONNECTION_LOCK_FLAG -#define free loserfree -#define malloc losermalloc -#define exit loserexit -#define abort loserabort -/* For XlibDisplayWriting */ -#include <X11/Xlibint.h> -#endif - -/* Check whether display connection DPYINFO is hung - because its thread-interlock is locked. - If it is, close the connection. - Do nothing if this system does not have a thread interlock. */ - -x_connection_close_if_hung (dpyinfo) - struct x_display_info *dpyinfo; -{ - /* This tests (1) whether X_CONNECTION_LOCK_FLAG is defined at all, - and (2) whether the name it is defined as is itself defined. - (It ought to have been defined by Xlibint.h. */ -#if X_CONNECTION_LOCK_FLAG - - if (dpyinfo->display->flags & X_CONNECTION_LOCK_FLAG) - { - /* If the thread-interlock is locked, assume this connection is dead. - This assumes that the library does not make other threads - that can be locking the display legitimately. */ - - dpyinfo->display->flags &= ~X_CONNECTION_LOCK_FLAG; - x_connection_closed (dpyinfo->display, "connection was lost"); - } -#endif /* X_CONNECTION_LOCK_FLAG */ -} - -/* Don't put any additional functions here! */ #endif /* not HAVE_X_WINDOWS */