mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-30 15:38:06 +01:00
Add some missing requests for the read-side to wakeup the write-side. Also
add some missing wakeups by the write side to the read side.
This commit is contained in:
parent
015234b2e8
commit
5af564b4f4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13992
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user