comparison src/sysdep.c @ 12070:305d8df294a5

(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.
author Karl Heuer <kwzh@gnu.org>
date Mon, 05 Jun 1995 12:35:03 +0000
parents 00a37f7ba63c
children c00af359fde5
comparison
equal deleted inserted replaced
12069:505dc29a68cf 12070:305d8df294a5
1128 1128
1129 1129
1130 /* The initial tty mode bits */ 1130 /* The initial tty mode bits */
1131 struct emacs_tty old_tty; 1131 struct emacs_tty old_tty;
1132 1132
1133 int term_initted; /* 1 if outer tty status has been recorded */ 1133 /* 1 if we have been through init_sys_modes. */
1134 int term_initted;
1135
1136 /* 1 if outer tty status has been recorded. */
1137 int 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
1137 sigio. */ 1141 sigio. */
1138 int lmode; 1142 int lmode;
1217 needs the initialization code below. */ 1221 needs the initialization code below. */
1218 if (!read_socket_hook && EQ (Vwindow_system, Qnil)) 1222 if (!read_socket_hook && EQ (Vwindow_system, Qnil))
1219 #endif 1223 #endif
1220 { 1224 {
1221 EMACS_GET_TTY (input_fd, &old_tty); 1225 EMACS_GET_TTY (input_fd, &old_tty);
1226
1227 old_tty_valid = 1;
1222 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)
1226 #ifdef DGUX 1232 #ifdef DGUX
1648 #ifdef BSD4_1 1654 #ifdef BSD4_1
1649 if (interrupt_input) 1655 if (interrupt_input)
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 ();
1658 #endif 1665 #endif
1659 1666