diff options
author | Sebastien Marie <semarie@cvs.openbsd.org> | 2019-07-14 10:21:12 +0000 |
---|---|---|
committer | Sebastien Marie <semarie@cvs.openbsd.org> | 2019-07-14 10:21:12 +0000 |
commit | 57aff656dc2fb9e73fb25e2bc0908f2fc28e8b17 (patch) | |
tree | b204ea24a768912e1948a9513af95c44651828a7 /sys/kern/sys_pipe.c | |
parent | 88b2c65bf15734148cde7369d43a263eb77117f1 (diff) |
rename PIPE_WANT to PIPE_WANTD.
PIPE_WANT flag is used for signaling the pipe is about to be run-down.
Pending readers/writers will wakeup the closing thread which is waiting.
We already have PIPE_WANTR, PIPE_WANTW and PIPE_LWANT flags, so
PIPE_WANT isn't really descriptive.
No functional changes intented.
ok visa@ anton@ mpi@
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r-- | sys/kern/sys_pipe.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 1df0c0e4dd3..9fecf1b6df6 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_pipe.c,v 1.91 2019/07/13 06:51:59 semarie Exp $ */ +/* $OpenBSD: sys_pipe.c,v 1.92 2019/07/14 10:21:11 semarie Exp $ */ /* * Copyright (c) 1996 John S. Dyson @@ -404,10 +404,10 @@ unlocked_error: --rpipe->pipe_busy; /* - * PIPE_WANT processing only makes sense if pipe_busy is 0. + * PIPE_WANTD processing only makes sense if pipe_busy is 0. */ - if ((rpipe->pipe_busy == 0) && (rpipe->pipe_state & PIPE_WANT)) { - rpipe->pipe_state &= ~(PIPE_WANT|PIPE_WANTW); + if ((rpipe->pipe_busy == 0) && (rpipe->pipe_state & PIPE_WANTD)) { + rpipe->pipe_state &= ~(PIPE_WANTD|PIPE_WANTW); wakeup(rpipe); } else if (rpipe->pipe_buffer.cnt < MINPIPESIZE) { /* @@ -475,8 +475,8 @@ pipe_write(struct file *fp, struct uio *uio, int fflags) if (error) { --wpipe->pipe_busy; if ((wpipe->pipe_busy == 0) && - (wpipe->pipe_state & PIPE_WANT)) { - wpipe->pipe_state &= ~(PIPE_WANT | PIPE_WANTR); + (wpipe->pipe_state & PIPE_WANTD)) { + wpipe->pipe_state &= ~(PIPE_WANTD | PIPE_WANTR); wakeup(wpipe); } goto done; @@ -619,8 +619,8 @@ retrywrite: --wpipe->pipe_busy; - if ((wpipe->pipe_busy == 0) && (wpipe->pipe_state & PIPE_WANT)) { - wpipe->pipe_state &= ~(PIPE_WANT | PIPE_WANTR); + if ((wpipe->pipe_busy == 0) && (wpipe->pipe_state & PIPE_WANTD)) { + wpipe->pipe_state &= ~(PIPE_WANTD | PIPE_WANTR); wakeup(wpipe); } else if (wpipe->pipe_buffer.cnt > 0) { /* @@ -806,7 +806,7 @@ pipeclose(struct pipe *cpipe) cpipe->pipe_state |= PIPE_EOF; while (cpipe->pipe_busy) { wakeup(cpipe); - cpipe->pipe_state |= PIPE_WANT; + cpipe->pipe_state |= PIPE_WANTD; tsleep(cpipe, PRIBIO, "pipecl", 0); } |