summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-11-21 17:40:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-11-21 17:40:27 +0000
commitebb93c762e57e0136484a6293bd575c91baa8a42 (patch)
tree08e27c8ca4c3853ddd7e54bdc442c13a8eb45fbf
parent7eabe0ffbc45974f93a7a824fdd7d2b5b9400825 (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.c5
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.