diff options
author | John Dyson <dyson@FreeBSD.org> | 1996-01-31 06:00:45 +0000 |
---|---|---|
committer | John Dyson <dyson@FreeBSD.org> | 1996-01-31 06:00:45 +0000 |
commit | 4ab7a1a6c7a3b6e1f4e56b05c5903556fc8e8093 (patch) | |
tree | af0faadbf2ee1c2ce345c617a96eaa7c598877ec /sys/kern/sys_pipe.c | |
parent | 3bc746be91c04a326969480c00af3c56d20c32aa (diff) | |
download | src-4ab7a1a6c7a3b6e1f4e56b05c5903556fc8e8093.tar.gz src-4ab7a1a6c7a3b6e1f4e56b05c5903556fc8e8093.zip |
Notes
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r-- | sys/kern/sys_pipe.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 653b49536fa9..dda604a93e0c 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.2 1996/01/29 02:57:33 dyson Exp $ + * $Id: sys_pipe.c,v 1.3 1996/01/31 02:05:12 dyson Exp $ */ #ifndef OLD_PIPE @@ -191,10 +191,11 @@ static __inline int pipelock(cpipe) struct pipe *cpipe; { + int error; while (cpipe->pipe_state & PIPE_LOCK) { cpipe->pipe_state |= PIPE_LWANT; - if (tsleep( &cpipe->pipe_state, PRIBIO|PCATCH, "pipelk", 0)) { - return ERESTART; + if (error = tsleep( &cpipe->pipe_state, PRIBIO|PCATCH, "pipelk", 0)) { + return error; } } cpipe->pipe_state |= PIPE_LOCK; @@ -290,8 +291,7 @@ pipe_read(fp, uio, cred) break; } rpipe->pipe_state |= PIPE_WANTR; - if (tsleep(rpipe, PRIBIO|PCATCH, "piperd", 0)) { - error = ERESTART; + if (error = tsleep(rpipe, PRIBIO|PCATCH, "piperd", 0)) { break; } } @@ -387,8 +387,7 @@ pipe_write(fp, uio, cred) break; } wpipe->pipe_state |= PIPE_WANTW; - if (tsleep(wpipe, (PRIBIO+1)|PCATCH, "pipewr", 0)) { - error = ERESTART; + if (error = tsleep(wpipe, (PRIBIO+1)|PCATCH, "pipewr", 0)) { break; } /* |