aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 41bbd92c43d..9d352ab1beb 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1130,7 +1130,11 @@ emacs_set_tty (fd, settings, waitp)
1130/* The initial tty mode bits */ 1130/* The initial tty mode bits */
1131struct emacs_tty old_tty; 1131struct emacs_tty old_tty;
1132 1132
1133int term_initted; /* 1 if outer tty status has been recorded */ 1133/* 1 if we have been through init_sys_modes. */
1134int term_initted;
1135
1136/* 1 if outer tty status has been recorded. */
1137int old_tty_valid;
1134 1138
1135#ifdef BSD4_1 1139#ifdef BSD4_1
1136/* BSD 4.1 needs to keep track of the lmode bits in order to start 1140/* BSD 4.1 needs to keep track of the lmode bits in order to start
@@ -1220,6 +1224,8 @@ init_sys_modes ()
1220 { 1224 {
1221 EMACS_GET_TTY (input_fd, &old_tty); 1225 EMACS_GET_TTY (input_fd, &old_tty);
1222 1226
1227 old_tty_valid = 1;
1228
1223 tty = old_tty; 1229 tty = old_tty;
1224 1230
1225#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) 1231#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
@@ -1650,8 +1656,9 @@ reset_sys_modes ()
1650 reset_sigio (); 1656 reset_sigio ();
1651#endif /* BSD4_1 */ 1657#endif /* BSD4_1 */
1652 1658
1653 while (EMACS_SET_TTY (input_fd, &old_tty, 0) < 0 && errno == EINTR) 1659 if (old_tty_valid)
1654 ; 1660 while (EMACS_SET_TTY (input_fd, &old_tty, 0) < 0 && errno == EINTR)
1661 ;
1655 1662
1656#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */ 1663#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */
1657 dos_ttcooked (); 1664 dos_ttcooked ();