# HG changeset patch # User Gerd Moellmann # Date 977144040 0 # Node ID 77cda2c018e5467a66a42f66dd58c35874e79a02 # Parent 8f55d03259dea997ca22176444ac31b0da3b07f4 (x_connection_closed): Prevent being called recursively because of an error condition in XtCloseDisplay. diff -r 8f55d03259de -r 77cda2c018e5 src/xterm.c --- a/src/xterm.c Mon Dec 18 12:36:36 2000 +0000 +++ b/src/xterm.c Mon Dec 18 12:54:00 2000 +0000 @@ -11256,11 +11256,11 @@ /* 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 @@ 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. */