]> git.eshelyaron.com Git - emacs.git/commitdiff
(kbd_buffer_get_event): If user destroys the last frame,
authorRichard M. Stallman <rms@gnu.org>
Fri, 26 Nov 1993 21:54:39 +0000 (21:54 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 26 Nov 1993 21:54:39 +0000 (21:54 +0000)
exit before calling Fdelete_frame.

(read_avail_input): Undo Nov 18 change.

src/keyboard.c

index 166b8b5477967d857f6e3550f330a763d15424af..d82ae463ce38f7929b642deb9ff3cecc9689ad15 100644 (file)
@@ -1944,12 +1944,13 @@ kbd_buffer_get_event ()
        {
          Lisp_Object value;
 
-         Fdelete_frame (event->frame_or_window, Qt);
-         kbd_fetch_ptr = event + 1;
-
+         /* If the user destroys the only frame, Emacs should exit.  */
          value = Fvisible_frame_list ();
-         if (! CONSP (value))
+         if (! CONSP (value) || ! CONSP (XCONS (value)->cdr))
            kill (getpid (), SIGHUP);
+
+         Fdelete_frame (event->frame_or_window, Qt);
+         kbd_fetch_ptr = event + 1;
        }
 #endif
       /* Just discard these, by returning nil.
@@ -3072,26 +3073,25 @@ read_avail_input (expected)
       /* Now read; for one reason or another, this will not block.  */
       while (1)
        {
-         int value = read (fileno (stdin), cbuf, nread);
+         nread = read (fileno (stdin), cbuf, nread);
 #ifdef AIX
          /* The kernel sometimes fails to deliver SIGHUP for ptys.
             This looks incorrect, but it isn't, because _BSD causes
             O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
             and that causes a value other than 0 when there is no input.  */
-         if (value == 0)
+         if (nread == 0)
            kill (SIGHUP, 0);
 #endif
+         /* This code is wrong, but at least it gets the right results.
+            Fix it for 19.23.  */
          /* Retry the read if it is interrupted.  */
-         if (value >= 0
+         if (nread >= 0
              || ! (errno == EAGAIN || errno == EFAULT
 #ifdef EBADSLT
                    || errno == EBADSLT
 #endif
                    ))
-           {
-             nread = value;
-             break;
-           }
+           break;
        }
 
 #ifndef FIONREAD