aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-11-26 21:54:39 +0000
committerRichard M. Stallman1993-11-26 21:54:39 +0000
commit854f3a54d23485aff14faf2d7c9fc81e335d5d66 (patch)
tree75ae294dd3165c6a1aaf28c48bee03793aceb8f6 /src
parentdcce9abd1c4d56f1ca876ba3b2141ebd65a57964 (diff)
downloademacs-854f3a54d23485aff14faf2d7c9fc81e335d5d66.tar.gz
emacs-854f3a54d23485aff14faf2d7c9fc81e335d5d66.zip
(kbd_buffer_get_event): If user destroys the last frame,
exit before calling Fdelete_frame. (read_avail_input): Undo Nov 18 change.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 166b8b54779..d82ae463ce3 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1944,12 +1944,13 @@ kbd_buffer_get_event ()
1944 { 1944 {
1945 Lisp_Object value; 1945 Lisp_Object value;
1946 1946
1947 Fdelete_frame (event->frame_or_window, Qt); 1947 /* If the user destroys the only frame, Emacs should exit. */
1948 kbd_fetch_ptr = event + 1;
1949
1950 value = Fvisible_frame_list (); 1948 value = Fvisible_frame_list ();
1951 if (! CONSP (value)) 1949 if (! CONSP (value) || ! CONSP (XCONS (value)->cdr))
1952 kill (getpid (), SIGHUP); 1950 kill (getpid (), SIGHUP);
1951
1952 Fdelete_frame (event->frame_or_window, Qt);
1953 kbd_fetch_ptr = event + 1;
1953 } 1954 }
1954#endif 1955#endif
1955 /* Just discard these, by returning nil. 1956 /* Just discard these, by returning nil.
@@ -3072,26 +3073,25 @@ read_avail_input (expected)
3072 /* Now read; for one reason or another, this will not block. */ 3073 /* Now read; for one reason or another, this will not block. */
3073 while (1) 3074 while (1)
3074 { 3075 {
3075 int value = read (fileno (stdin), cbuf, nread); 3076 nread = read (fileno (stdin), cbuf, nread);
3076#ifdef AIX 3077#ifdef AIX
3077 /* The kernel sometimes fails to deliver SIGHUP for ptys. 3078 /* The kernel sometimes fails to deliver SIGHUP for ptys.
3078 This looks incorrect, but it isn't, because _BSD causes 3079 This looks incorrect, but it isn't, because _BSD causes
3079 O_NDELAY to be defined in fcntl.h as O_NONBLOCK, 3080 O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
3080 and that causes a value other than 0 when there is no input. */ 3081 and that causes a value other than 0 when there is no input. */
3081 if (value == 0) 3082 if (nread == 0)
3082 kill (SIGHUP, 0); 3083 kill (SIGHUP, 0);
3083#endif 3084#endif
3085 /* This code is wrong, but at least it gets the right results.
3086 Fix it for 19.23. */
3084 /* Retry the read if it is interrupted. */ 3087 /* Retry the read if it is interrupted. */
3085 if (value >= 0 3088 if (nread >= 0
3086 || ! (errno == EAGAIN || errno == EFAULT 3089 || ! (errno == EAGAIN || errno == EFAULT
3087#ifdef EBADSLT 3090#ifdef EBADSLT
3088 || errno == EBADSLT 3091 || errno == EBADSLT
3089#endif 3092#endif
3090 )) 3093 ))
3091 { 3094 break;
3092 nread = value;
3093 break;
3094 }
3095 } 3095 }
3096 3096
3097#ifndef FIONREAD 3097#ifndef FIONREAD