[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0909040917120.4537@eeepc.linux-foundation.org>
Date: Fri, 4 Sep 2009 09:19:34 -1000 (HST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Mikael Pettersson <mikpe@...uu.se>
cc: "Rafael J. Wysocki" <rjw@...k.pl>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Kernel Testers List <kernel-testers@...r.kernel.org>,
Alan Cox <alan@...ux.intel.com>, Greg KH <gregkh@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Subject: Re: [Bug #14015] pty regressed again, breaking expect and gcc's
testsuite
On Fri, 4 Sep 2009, Linus Torvalds wrote:
>
> I'm sure you already figured the obvious meaning out, but here's a fixed
> version.
And here's another patch that may also fix this, simply by virtue of
writing the "\r\n" as a single string, rather than as two characters. That
way, we should never get into the situation that th '\r' allocates a new
buffer (larger than one character), and then the later '\n' writing
decides that we've filled up.
Besides, it's a cleanup. An untested one, naturally.
Linus
---
drivers/char/n_tty.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 973be2f..4e28b35 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -300,8 +300,7 @@ static int do_output_char(unsigned char c, struct tty_struct *tty, int space)
if (space < 2)
return -1;
tty->canon_column = tty->column = 0;
- tty_put_char(tty, '\r');
- tty_put_char(tty, c);
+ tty->ops->write(tty, "\r\n", 2);
return 2;
}
tty->canon_column = tty->column;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists