Mercurial > emacs
changeset 5194:85a1088ca765
(kbd_buffer_get_event): If user destroys the last frame,
exit before calling Fdelete_frame.
(read_avail_input): Undo Nov 18 change.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 26 Nov 1993 21:54:39 +0000 |
parents | 2696563f32ba |
children | 9c64f67c4683 |
files | src/keyboard.c |
diffstat | 1 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/keyboard.c Fri Nov 26 21:50:57 1993 +0000 +++ b/src/keyboard.c Fri Nov 26 21:54:39 1993 +0000 @@ -1944,12 +1944,13 @@ { Lisp_Object value; + /* If the user destroys the only frame, Emacs should exit. */ + value = Fvisible_frame_list (); + if (! CONSP (value) || ! CONSP (XCONS (value)->cdr)) + kill (getpid (), SIGHUP); + Fdelete_frame (event->frame_or_window, Qt); kbd_fetch_ptr = event + 1; - - value = Fvisible_frame_list (); - if (! CONSP (value)) - kill (getpid (), SIGHUP); } #endif /* Just discard these, by returning nil. @@ -3072,26 +3073,25 @@ /* 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