Re: [Regression] kdesu broken
[Posted July 28, 2009 by corbet]
| From: |
| Alan Cox <alan-AT-lxorguk.ukuu.org.uk> |
| To: |
| OGAWA Hirofumi <hirofumi-AT-mail.parknet.co.jp> |
| Subject: |
| Re: [Regression] kdesu broken |
| Date: |
| Sat, 25 Jul 2009 15:05:10 +0100 |
| Message-ID: |
| <20090725150510.35e8854d@lxorguk.ukuu.org.uk> |
| Cc: |
| Linus Torvalds <torvalds-AT-linux-foundation.org>,
"Rafael J. Wysocki" <rjw-AT-sisk.pl>, Ray Lee <ray-lk-AT-madrabbit.org>,
LKML <linux-kernel-AT-vger.kernel.org>,
Andrew Morton <akpm-AT-linux-foundation.org> |
| Archive-link: |
| Article, Thread
|
Actually try this:
commit b0e6bdde87725a5d46273ecc4bd00c54bd675848
Author: Alan Cox <alan@linux.intel.com>
Date: Sat Jul 25 15:00:04 2009 +0100
pty: ensure writes hit the reader before close
This is elegant in all the wrong ways. Put the pty into low latency mode (which
we can do as we always post bytes from user context). The tty_flip_buffer_push
then always calls into the ldisc which means we clear the ldisc buffer before
we set the TTY_OTHER_CLOSED flag.
Means pty has subtle knowledge of tty internals we really don't want it to, but
it fixes the problem for the moment.
Signed-off-by: Alan Cox <alan@linux.intel.com>
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 6e6942c..87d729b 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -47,10 +47,12 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
}
wake_up_interruptible(&tty->read_wait);
wake_up_interruptible(&tty->write_wait);
+
tty->packet = 0;
if (!tty->link)
return;
tty->link->packet = 0;
+ tty_flip_buffer_push(tty->link);
set_bit(TTY_OTHER_CLOSED, &tty->link->flags);
wake_up_interruptible(&tty->link->read_wait);
wake_up_interruptible(&tty->link->write_wait);
@@ -207,6 +209,7 @@ static int pty_open(struct tty_struct *tty, struct file *filp)
clear_bit(TTY_OTHER_CLOSED, &tty->link->flags);
set_bit(TTY_THROTTLED, &tty->flags);
retval = 0;
+ tty->low_latency = 1;
out:
return retval;
}
(
Log in to post comments)