From: Gerd Moellmann Date: Mon, 18 Dec 2000 12:54:00 +0000 (+0000) Subject: (x_connection_closed): Prevent being called recursively X-Git-Tag: emacs-pretest-21.0.95~434 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5978125e6aa9491f41acfdbd243366494b475847;p=emacs.git (x_connection_closed): Prevent being called recursively because of an error condition in XtCloseDisplay. --- diff --git a/src/xterm.c b/src/xterm.c index d45dfd8c7e1..47b3f532e92 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11256,11 +11256,11 @@ x_connection_signal (signalnum) /* If we don't have an argument, */ /* Handle the loss of connection to display DISPLAY. */ static SIGTYPE -x_connection_closed (display, error_message) - Display *display; +x_connection_closed (dpy, error_message) + Display *dpy; char *error_message; { - struct x_display_info *dpyinfo = x_display_info_for_display (display); + struct x_display_info *dpyinfo = x_display_info_for_display (dpy); Lisp_Object frame, tail; /* We have to close the display to inform Xt that it doesn't @@ -11279,7 +11279,15 @@ x_connection_closed (display, error_message) in OpenWindows. I don't know how to cicumvent it here. */ #ifdef USE_X_TOOLKIT - XtCloseDisplay (display); + { + /* Prevent being called recursively because of an error condition + in XtCloseDisplay. Otherwise, we might end up with printing + ``can't find per display information'' in the recursive call + instead of printing the original message here. */ + int count = x_catch_errors (dpy); + XtCloseDisplay (dpy); + x_uncatch_errors (dpy, count); + } #endif /* Indicate that this display is dead. */