diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-11-21 17:40:27 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-11-21 17:40:27 +0000 |
commit | ebb93c762e57e0136484a6293bd575c91baa8a42 (patch) | |
tree | 08e27c8ca4c3853ddd7e54bdc442c13a8eb45fbf | |
parent | 7eabe0ffbc45974f93a7a824fdd7d2b5b9400825 (diff) |
if select returns writable on a pipe, the write should not return
EWOULDBLOCK. turns out the two checking conditions were not the same,
and a certain use of rsync uncovered the bug by chewing all available
cpu time; fix from art
-rw-r--r-- | sys/kern/sys_pipe.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 88472e3169c..8191b931467 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_pipe.c,v 1.20 1999/10/29 14:08:49 art Exp $ */ +/* $OpenBSD: sys_pipe.c,v 1.21 1999/11/21 17:40:26 deraadt Exp $ */ /* * Copyright (c) 1996 John S. Dyson @@ -462,7 +462,8 @@ pipe_write(fp, uio, cred) if ((space < uio->uio_resid) && (orig_resid <= PIPE_BUF)) space = 0; - if (space > 0 && (wpipe->pipe_buffer.cnt < PIPE_SIZE)) { + if (space > 0 && + (wpipe->pipe_buffer.cnt < wpipe->pipe_buffer.size)) { /* * This set the maximum transfer as a segment of * the buffer. |