]> Zhao Yanbai Git Server - minix.git/commitdiff
TTY: fix earlier PTY select "improvement"
authorDavid van Moolenbroek <david@minix3.org>
Fri, 4 Oct 2013 23:40:58 +0000 (01:40 +0200)
committerLionel Sambuc <lionel@minix3.org>
Sat, 1 Mar 2014 08:04:58 +0000 (09:04 +0100)
It was just plain wrong.

Change-Id: Ieab4b4f01d9461e05e0d0ba6427a99d863d6b98d

drivers/tty/pty.c

index 6f3d0fcdb80f2c8c14418a0be7ca4f8c8d1e7173..22b108f420e8f02ecf46d5ee51535f54b33d50d0 100644 (file)
@@ -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) {