public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Joe Peterson <joe@skyrush.com>
Cc: linux-kernel@vger.kernel.org, alan@lxorguk.ukuu.org.uk
Subject: Re: [PATCH] (*revised*) Fix IXANY and restart after signal (e.g. ctrl-C) in n_tty line discipline
Date: Thu, 17 Jan 2008 16:11:56 -0800	[thread overview]
Message-ID: <20080117161156.92737c80.akpm@linux-foundation.org> (raw)
In-Reply-To: <478FE861.4000705@skyrush.com>

On Thu, 17 Jan 2008 16:44:33 -0700
Joe Peterson <joe@skyrush.com> wrote:

> Here is a revised version of my patch, currently in the -mm kernel as
> "fix-ixany-and-restart-after-signal-eg-ctrl-c-in-n_tty-line-discipline".
> It fixes a couple of issues with ttys in the stopped state.  See patch
> below for more details.

What were the "couple of issues"?

> This patch should *replace* the old version of the patch.

I don't like replacements a lot.  It forces one to re-review the whole
thing from scratch.  Which is why I almost always turn the replacement
into an incremental patch, as below.

>  It is
> cleaner, and its behavior better matches that of other Unix platforms.
> It also avoids needless/redundant calls to start_tty() when ctrl-S or
> ctrl-Q are hit.
> 

--- a/drivers/char/n_tty.c~fix-ixany-and-restart-after-signal-eg-ctrl-c-in-n_tty-line-discipline-update
+++ a/drivers/char/n_tty.c
@@ -695,14 +695,16 @@ static inline void n_tty_receive_char(st
 		return;
 	}
 	
-	if (tty->stopped && !tty->flow_stopped && I_IXON(tty) && I_IXANY(tty))
-		start_tty(tty);
-	
 	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))
@@ -766,8 +768,6 @@ static inline void n_tty_receive_char(st
 		signal = SIGTSTP;
 		if (c == SUSP_CHAR(tty)) {
 send_signal:
-			if (tty->stopped && !tty->flow_stopped && I_IXON(tty))
-				start_tty(tty);
 			/*
 			 * Echo character, and then send the signal.
 			 * Note that we do not use isig() here because we want
_


  reply	other threads:[~2008-01-18  0:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-22 14:19 [PATCH] Fix IXANY and restart after signal (e.g. ctrl-C) in n_tty line discipline Joe Peterson
2008-01-17 23:44 ` [PATCH] (*revised*) " Joe Peterson
2008-01-18  0:11   ` Andrew Morton [this message]
2008-01-18  0:38     ` Joe Peterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080117161156.92737c80.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=joe@skyrush.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox