summaryrefslogtreecommitdiff
path: root/sys/kern/sys_pipe.c
diff options
context:
space:
mode:
authorJohn Dyson <dyson@FreeBSD.org>1996-02-09 04:36:36 +0000
committerJohn Dyson <dyson@FreeBSD.org>1996-02-09 04:36:36 +0000
commit5af564b4f4b77979f9f12ab32317d99314e260fc (patch)
tree71e03585d3eb015e7f6089c40078a824ee90cdfa /sys/kern/sys_pipe.c
parent015234b2e87e65e014fb79885fa4753efb2df659 (diff)
Notes
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r--sys/kern/sys_pipe.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 3e627f72a885..fbce3dbf9897 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: sys_pipe.c,v 1.8 1996/02/05 05:50:34 dyson Exp $
+ * $Id: sys_pipe.c,v 1.9 1996/02/07 06:41:56 dyson Exp $
*/
#ifndef OLD_PIPE
@@ -591,7 +591,7 @@ retry:
wpipe->pipe_state &= ~PIPE_WANTR;
wakeup(wpipe);
}
-
+ wpipe->pipe_state |= PIPE_WANTW;
error = tsleep(wpipe,
PRIBIO|PCATCH, "pipdww", 0);
if (error || (wpipe->pipe_state & PIPE_EOF))
@@ -604,6 +604,7 @@ retry:
wakeup(wpipe);
}
+ wpipe->pipe_state |= PIPE_WANTW;
error = tsleep(wpipe,
PRIBIO|PCATCH, "pipdwc", 0);
if (error || (wpipe->pipe_state & PIPE_EOF)) {
@@ -637,6 +638,10 @@ retry:
wakeup(wpipe);
return EPIPE;
}
+ if (wpipe->pipe_state & PIPE_WANTR) {
+ wpipe->pipe_state &= ~PIPE_WANTR;
+ wakeup(wpipe);
+ }
error = tsleep(wpipe, PRIBIO|PCATCH, "pipdwt", 0);
}
@@ -708,6 +713,10 @@ pipewrite(wpipe, uio, nbio)
*/
retrywrite:
while (wpipe->pipe_state & PIPE_DIRECTW) {
+ if (wpipe->pipe_state & PIPE_WANTR) {
+ wpipe->pipe_state &= ~PIPE_WANTR;
+ wakeup(wpipe);
+ }
error = tsleep(wpipe,
PRIBIO|PCATCH, "pipbww", 0);
if (error)