diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2013-01-02 16:14:57 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2013-01-02 16:14:57 +0000 |
commit | b04987c044f8884ca854ad702deccaa6a8f85408 (patch) | |
tree | 86aacd1d50b56beb0e27b82c208fc6d63b64d5f9 /sys | |
parent | 64f599668239b805c7c35390028e06e4bbdb4f8d (diff) |
Fix a bug in ptcwrite() that could result in up to 100 lost bytes
when we block due to hitting the TTYHOG limit. OK miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/tty_pty.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 4ef264ff9f0..d345c1438bf 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_pty.c,v 1.58 2012/04/22 05:43:14 guenther Exp $ */ +/* $OpenBSD: tty_pty.c,v 1.59 2013/01/02 16:14:56 millert Exp $ */ /* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */ /* @@ -550,7 +550,7 @@ again: wakeup(&tp->t_canq); goto done; } - while (uio->uio_resid > 0) { + do { if (cc == 0) { cc = MIN(uio->uio_resid, BUFSIZ); if (cc > bufcc) @@ -577,7 +577,7 @@ again: cc--; } cc = 0; - } + } while (uio->uio_resid > 0); goto done; block: /* |