diff options
Diffstat (limited to 'drivers/char/n_tty.c')
-rw-r--r-- | drivers/char/n_tty.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index f8111121f..28964d27e 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -345,7 +345,7 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) return; } - if (tty->stopped && I_IXON(tty) && I_IXANY(tty) && L_IEXTEN(tty)) { + if (tty->stopped && I_IXON(tty) && I_IXANY(tty)) { start_tty(tty); return; } @@ -355,6 +355,16 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) if (I_IUCLC(tty) && L_IEXTEN(tty)) c=tolower(c); + if (tty->closing) { + if (I_IXON(tty)) { + if (c == START_CHAR(tty)) + start_tty(tty); + else if (c == STOP_CHAR(tty)) + stop_tty(tty); + } + return; + } + /* * If the previous character was LNEXT, or we know that this * character is not one of the characters that we'll have to @@ -615,7 +625,7 @@ static void n_tty_set_termios(struct tty_struct *tty, struct termios * old) I_IXON(tty) || L_ISIG(tty) || L_ECHO(tty) || I_PARMRK(tty)) { cli(); - memset(tty->process_char_map, 0, 256/32); + memset(tty->process_char_map, 0, 256/8); if (I_IGNCR(tty) || I_ICRNL(tty)) set_bit('\r', &tty->process_char_map); @@ -666,7 +676,6 @@ static void n_tty_set_termios(struct tty_struct *tty, struct termios * old) static void n_tty_close(struct tty_struct *tty) { - wait_until_sent(tty, 0); n_tty_flush_buffer(tty); if (tty->read_buf) { free_page((unsigned long) tty->read_buf); @@ -690,6 +699,7 @@ static int n_tty_open(struct tty_struct *tty) memset(tty->read_flags, 0, sizeof(tty->read_flags)); n_tty_set_termios(tty, 0); tty->minimum_to_wake = 1; + tty->closing = 0; return 0; } |