Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=54d2a37eda3211d3b14c162238e9ccee43e023a9
Commit:     54d2a37eda3211d3b14c162238e9ccee43e023a9
Parent:     1373bed34e30b8632aaf43aa85d72329c83f7077
Author:     Joe Peterson <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 01:37:59 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Feb 6 10:41:09 2008 -0800

    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 <[EMAIL PROTECTED]>
    Cc: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/char/n_tty.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index e0e3815..90c3969 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)
                return;
        }
        
-       if (tty->stopped && !tty->flow_stopped &&
-           I_IXON(tty) && I_IXANY(tty)) {
-               start_tty(tty);
-               return;
-       }
-       
        if (I_ISTRIP(tty))
                c &= 0x7f;
        if (I_IUCLC(tty) && L_IEXTEN(tty))
                c=tolower(c);
 
+       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)))
+               start_tty(tty);
+
        if (tty->closing) {
                if (I_IXON(tty)) {
                        if (c == START_CHAR(tty))
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to