aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2014-08-02 14:31:18 -0700
committerPaul Eggert2014-08-02 14:31:18 -0700
commit7f0ff25b7a056570e2435a88b9bb736501aaa12b (patch)
tree7713fd3134cb7640cc934f0812192691a349b610 /src
parent69402c0269859f30be8b62ccd313292db0e73693 (diff)
downloademacs-7f0ff25b7a056570e2435a88b9bb736501aaa12b.tar.gz
emacs-7f0ff25b7a056570e2435a88b9bb736501aaa12b.zip
Avoid 100% CPU utilization on ssh session exit.
* src/xterm.h (struct x_display_info): New member 'connection'. * src/xterm.c (x_term_init, x_delete_terminal): Set and use it, so that x_delete_terminal has a file descriptor to pass to delete_keyboard_wait_descriptor. Fixes: debbugs:17691
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/xterm.c9
-rw-r--r--src/xterm.h3
3 files changed, 15 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 13415734c79..b85aee0d35a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12014-08-02 Paul Eggert <eggert@cs.ucla.edu>
2
3 Avoid 100% CPU utilization on ssh session exit (Bug#17691).
4 * xterm.h (struct x_display_info): New member 'connection'.
5 * xterm.c (x_term_init, x_delete_terminal): Set and use it,
6 so that x_delete_terminal has a file descriptor to pass to
7 delete_keyboard_wait_descriptor.
8
12014-08-01 Eli Zaretskii <eliz@gnu.org> 92014-08-01 Eli Zaretskii <eliz@gnu.org>
2 10
3 Fix display of R2L lines when the last character fits only partially. 11 Fix display of R2L lines when the last character fits only partially.
diff --git a/src/xterm.c b/src/xterm.c
index ed98fb10b89..7723f1af77f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -9932,6 +9932,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
9932 9932
9933 dpyinfo->name_list_element = Fcons (display_name, Qnil); 9933 dpyinfo->name_list_element = Fcons (display_name, Qnil);
9934 dpyinfo->display = dpy; 9934 dpyinfo->display = dpy;
9935 dpyinfo->connection = ConnectionNumber (dpyinfo->display);
9935 9936
9936 /* Set the name of the terminal. */ 9937 /* Set the name of the terminal. */
9937 terminal->name = xlispstrdup (display_name); 9938 terminal->name = xlispstrdup (display_name);
@@ -10360,7 +10361,6 @@ void
10360x_delete_terminal (struct terminal *terminal) 10361x_delete_terminal (struct terminal *terminal)
10361{ 10362{
10362 struct x_display_info *dpyinfo = terminal->display_info.x; 10363 struct x_display_info *dpyinfo = terminal->display_info.x;
10363 int connection = -1;
10364 10364
10365 /* Protect against recursive calls. delete_frame in 10365 /* Protect against recursive calls. delete_frame in
10366 delete_terminal calls us back when it deletes our last frame. */ 10366 delete_terminal calls us back when it deletes our last frame. */
@@ -10379,8 +10379,6 @@ x_delete_terminal (struct terminal *terminal)
10379 and dpyinfo->display was set to 0 to indicate that. */ 10379 and dpyinfo->display was set to 0 to indicate that. */
10380 if (dpyinfo->display) 10380 if (dpyinfo->display)
10381 { 10381 {
10382 connection = ConnectionNumber (dpyinfo->display);
10383
10384 x_destroy_all_bitmaps (dpyinfo); 10382 x_destroy_all_bitmaps (dpyinfo);
10385 XSetCloseDownMode (dpyinfo->display, DestroyAll); 10383 XSetCloseDownMode (dpyinfo->display, DestroyAll);
10386 10384
@@ -10422,11 +10420,12 @@ x_delete_terminal (struct terminal *terminal)
10422 } 10420 }
10423 10421
10424 /* No more input on this descriptor. */ 10422 /* No more input on this descriptor. */
10425 if (connection != -1) 10423 if (0 <= dpyinfo->connection)
10426 delete_keyboard_wait_descriptor (connection); 10424 delete_keyboard_wait_descriptor (dpyinfo->connection);
10427 10425
10428 /* Mark as dead. */ 10426 /* Mark as dead. */
10429 dpyinfo->display = NULL; 10427 dpyinfo->display = NULL;
10428 dpyinfo->connection = -1;
10430 x_delete_display (dpyinfo); 10429 x_delete_display (dpyinfo);
10431 unblock_input (); 10430 unblock_input ();
10432} 10431}
diff --git a/src/xterm.h b/src/xterm.h
index 50df88cb592..2bed0d1d5d1 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -137,6 +137,9 @@ struct x_display_info
137 /* This says how to access this display in Xlib. */ 137 /* This says how to access this display in Xlib. */
138 Display *display; 138 Display *display;
139 139
140 /* A connection number (file descriptor) for the display. */
141 int connection;
142
140 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). */ 143 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). */
141 Lisp_Object name_list_element; 144 Lisp_Object name_list_element;
142 145