aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Peterson <joe@skyrush.com>2008-02-06 04:37:59 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:09 -0500
commit54d2a37eda3211d3b14c162238e9ccee43e023a9 (patch)
tree53318adeb908a9f6f4f9ce81ca41043cb0b248b8
parent1373bed34e30b8632aaf43aa85d72329c83f7077 (diff)
Fix IXANY and restart after signal (e.g. ctrl-C) in n_tty line discipline
Fix two N_TTY line discipline issues related to resuming a stopped TTY (typically done with ctrl-S): 1) Fix handling of character that resumes a stopped TTY (with IXANY) With "stty ixany", the TTY line discipline would lose the first character after the stop, so typing, for example, "hi^Sthere" resulted in "hihere" (the 't' would cause the resume after ^S, but it would then be thrown away rather than processed as an input character). This was inconsistent with the behavior of other Unix systems. 2) Fix interrupt signal (e.g. ctrl-C) behavior in stopped TTYs With "stty -ixany" (often the default), interrupt signals were ignored in a stopped TTY until the TTY was resumed with the start char (typically ctrl-Q), which was inconsistent with the behavior of other Unix systems. Signed-off-by: Joe Peterson <joe@skyrush.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/char/n_tty.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index e0e3815f92ba..90c3969012a3 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -695,17 +695,16 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
695 return; 695 return;
696 } 696 }
697 697
698 if (tty->stopped && !tty->flow_stopped &&
699 I_IXON(tty) && I_IXANY(tty)) {
700 start_tty(tty);
701 return;
702 }
703
704 if (I_ISTRIP(tty)) 698 if (I_ISTRIP(tty))
705 c &= 0x7f; 699 c &= 0x7f;
706 if (I_IUCLC(tty) && L_IEXTEN(tty)) 700 if (I_IUCLC(tty) && L_IEXTEN(tty))
707 c=tolower(c); 701 c=tolower(c);
708 702
703 if (tty->stopped && !tty->flow_stopped && I_IXON(tty) &&
704 ((I_IXANY(tty) && c != START_CHAR(tty) && c != STOP_CHAR(tty)) ||
705 c == INTR_CHAR(tty) || c == QUIT_CHAR(tty)))
706 start_tty(tty);
707
709 if (tty->closing) { 708 if (tty->closing) {
710 if (I_IXON(tty)) { 709 if (I_IXON(tty)) {
711 if (c == START_CHAR(tty)) 710 if (c == START_CHAR(tty))