mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-26 07:11:34 -08:00
(old_tty_valid): New variable.
(init_sys_modes): Set old_tty_valid if we set old_tty. (reset_sys_modes): Restore tty settings only if old_tty_valid.
This commit is contained in:
parent
866f60fd75
commit
7e32a4fbae
1 changed files with 10 additions and 3 deletions
13
src/sysdep.c
13
src/sysdep.c
|
|
@ -1130,7 +1130,11 @@ emacs_set_tty (fd, settings, waitp)
|
|||
/* The initial tty mode bits */
|
||||
struct emacs_tty old_tty;
|
||||
|
||||
int term_initted; /* 1 if outer tty status has been recorded */
|
||||
/* 1 if we have been through init_sys_modes. */
|
||||
int term_initted;
|
||||
|
||||
/* 1 if outer tty status has been recorded. */
|
||||
int old_tty_valid;
|
||||
|
||||
#ifdef BSD4_1
|
||||
/* BSD 4.1 needs to keep track of the lmode bits in order to start
|
||||
|
|
@ -1220,6 +1224,8 @@ init_sys_modes ()
|
|||
{
|
||||
EMACS_GET_TTY (input_fd, &old_tty);
|
||||
|
||||
old_tty_valid = 1;
|
||||
|
||||
tty = old_tty;
|
||||
|
||||
#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
|
||||
|
|
@ -1650,8 +1656,9 @@ reset_sys_modes ()
|
|||
reset_sigio ();
|
||||
#endif /* BSD4_1 */
|
||||
|
||||
while (EMACS_SET_TTY (input_fd, &old_tty, 0) < 0 && errno == EINTR)
|
||||
;
|
||||
if (old_tty_valid)
|
||||
while (EMACS_SET_TTY (input_fd, &old_tty, 0) < 0 && errno == EINTR)
|
||||
;
|
||||
|
||||
#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */
|
||||
dos_ttcooked ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue