in get_key_buffer(), only save all open buffers and hang up when a
blocking wgetch() returns ERR and errno is set to EIO (input/output error); if errno is set to something else, recover properly; this fixes problems with nano's erroneously hanging up while e.g. resizing or unsuspending in a chroot git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3038 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
7de4dc8d08
commit
6f5de42702
|
@ -325,6 +325,13 @@ CVS code -
|
||||||
the number of lines and characters in the file or selection,
|
the number of lines and characters in the file or selection,
|
||||||
as wc does. (DLR)
|
as wc does. (DLR)
|
||||||
- winio.c:
|
- winio.c:
|
||||||
|
get_key_buffer()
|
||||||
|
- Only save all open buffers and hang up when a blocking
|
||||||
|
wgetch() returns ERR and errno is set to EIO (input/output
|
||||||
|
error). If errno is set to something else, recover properly.
|
||||||
|
This fixes problems with nano's erroneously hanging up while
|
||||||
|
e.g. resizing or unsuspending in a chroot. (DLR, found by Mike
|
||||||
|
Frysinger)
|
||||||
get_escape_seq_kbinput()
|
get_escape_seq_kbinput()
|
||||||
- Fix typo preventing the VT100/VT220/VT320/xterm/rxvt escape
|
- Fix typo preventing the VT100/VT220/VT320/xterm/rxvt escape
|
||||||
sequence for ',' on the numeric keypad with NumLock off from
|
sequence for ',' on the numeric keypad with NumLock off from
|
||||||
|
|
12
src/winio.c
12
src/winio.c
|
@ -27,6 +27,7 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
|
|
||||||
|
@ -142,12 +143,13 @@ void get_key_buffer(WINDOW *win)
|
||||||
* screen updates. */
|
* screen updates. */
|
||||||
doupdate();
|
doupdate();
|
||||||
|
|
||||||
input = wgetch(win);
|
while ((input = wgetch(win)) == ERR) {
|
||||||
|
/* If errno is EIO, it means that the input source that we were
|
||||||
|
* using is gone, so die gracefully. */
|
||||||
|
if (errno == EIO)
|
||||||
|
handle_hupterm(0);
|
||||||
|
}
|
||||||
|
|
||||||
/* If we get ERR when using blocking input, it means that the input
|
|
||||||
* source that we were using is gone, so die gracefully. */
|
|
||||||
if (input == ERR)
|
|
||||||
handle_hupterm(0);
|
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
allow_pending_sigwinch(FALSE);
|
allow_pending_sigwinch(FALSE);
|
||||||
|
|
Loading…
Reference in New Issue