From cf3258890d0b34ff34a429ee3c008b66f15af5e2 Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 3 Aug 2006 22:51:05 +0000 Subject: [PATCH] PR/34129: Andreas Gustafsson: Nonblocking write to pty can return 0 If we cannot write on the slave side, always return EWOULDBLOCK in the non-blocking case, because we don't know that the buffer we started writing is actually in a system call boundary. --- sys/kern/tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index b5c08cfe436e..ca2fea9f4c58 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: tty.c,v 1.186 2006/07/23 22:06:11 ad Exp $ */ +/* $NetBSD: tty.c,v 1.187 2006/08/03 22:51:05 christos Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1991, 1993 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.186 2006/07/23 22:06:11 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.187 2006/08/03 22:51:05 christos Exp $"); #include #include @@ -2100,7 +2100,7 @@ ttwrite(struct tty *tp, struct uio *uio, int flag) if (flag & IO_NDELAY) { TTY_UNLOCK(tp); splx(s); - error = (uio->uio_resid == cnt) ? EWOULDBLOCK : 0; + error = EWOULDBLOCK; goto out; } SET(tp->t_state, TS_ASLEEP);