summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2007-08-07 11:30:54 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2007-08-07 11:30:54 +0000
commit0cf76e0076af46f7038d442af1c3533eec5eab5f (patch)
tree631b21e1b249a150c3f8e206e0650c50f5a4e70e
parentb2c2abcf8423db9e6c8459fc292c33d02bdca4f3 (diff)
Correctly deal with EOF on pipe wrt kqueue. Based on a fix present
in FreeBSD and NetBSD. OK art@ beck@
-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 dda76df3692..bb1985c8dec 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_pipe.c,v 1.51 2006/11/17 09:21:52 jmc Exp $ */
+/* $OpenBSD: sys_pipe.c,v 1.52 2007/08/07 11:30:53 millert Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
@@ -735,9 +735,10 @@ pipeclose(struct pipe *cpipe)
* If the other side is blocked, wake it up saying that
* we want to close it down.
*/
+ cpipe->pipe_state |= PIPE_EOF;
while (cpipe->pipe_busy) {
wakeup(cpipe);
- cpipe->pipe_state |= PIPE_WANT | PIPE_EOF;
+ cpipe->pipe_state |= PIPE_WANT;
tsleep(cpipe, PRIBIO, "pipecl", 0);
}