summaryrefslogtreecommitdiff
path: root/drivers/tty/n_tty.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2013-07-24 16:29:50 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-24 20:26:51 +0400
commit855df3c08968beac9d9a86536c43c0474684ac37 (patch)
treefef57ab15c274b68e4ab1a1739fbcd1c77cb1883 /drivers/tty/n_tty.c
parent7d88d637a3c75257b7611f9feee0c17fa187ecc9 (diff)
downloadlinux-855df3c08968beac9d9a86536c43c0474684ac37.tar.xz
n_tty: Eliminate char tests from IXANY restart test
Relocate the IXANY restart tty test to code paths where the the received char is not START_CHAR, STOP_CHAR, INTR_CHAR, QUIT_CHAR or SUSP_CHAR. Fixes the condition when ISIG if off and one of INTR_CHAR, QUIT_CHAR or SUSP_CHAR does not restart i/o. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r--drivers/tty/n_tty.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 951ecfeed8d3..f2e6bdb319cf 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1270,13 +1270,6 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
return;
}
- if (tty->stopped && !tty->flow_stopped && I_IXON(tty) &&
- I_IXANY(tty) && c != START_CHAR(tty) && c != STOP_CHAR(tty) &&
- c != INTR_CHAR(tty) && c != QUIT_CHAR(tty) && c != SUSP_CHAR(tty)) {
- start_tty(tty);
- process_echoes(tty);
- }
-
/*
* If the previous character was LNEXT, or we know that this
* character is not one of the characters that we'll have to
@@ -1285,6 +1278,13 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
*/
if (!test_bit(c, ldata->char_map) || ldata->lnext) {
ldata->lnext = 0;
+
+ if (tty->stopped && !tty->flow_stopped && I_IXON(tty) &&
+ I_IXANY(tty)) {
+ start_tty(tty);
+ process_echoes(tty);
+ }
+
parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0;
if (read_cnt(ldata) >= (N_TTY_BUF_SIZE - parmrk - 1)) {
/* beep if no space */
@@ -1331,6 +1331,11 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
}
}
+ if (tty->stopped && !tty->flow_stopped && I_IXON(tty) && I_IXANY(tty)) {
+ start_tty(tty);
+ process_echoes(tty);
+ }
+
if (c == '\r') {
if (I_IGNCR(tty))
return;