From b058039a350e8a150b95a143e52104a8f1711b81 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Sat, 5 Oct 2013 01:40:58 +0200 Subject: [PATCH] TTY: fix earlier PTY select "improvement" It was just plain wrong. Change-Id: Ieab4b4f01d9461e05e0d0ba6427a99d863d6b98d --- drivers/tty/pty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 6f3d0fcdb..22b108f42 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -269,7 +269,7 @@ static int select_try_pty(tty_t *tp, int ops) /* Write won't block on error. */ if (pp->state & TTY_CLOSED) r |= CDEV_OP_WR; else if (pp->wrleft != 0 || pp->wrcum != 0) r |= CDEV_OP_WR; - else if (tp->tty_inleft > 0) r |= CDEV_OP_WR; /* There's a reader. */ + else if (tp->tty_incount < buflen(tp->tty_inbuf)) r |= CDEV_OP_WR; } if (ops & CDEV_OP_RD) { -- 2.44.0