diff options
| author | John Dyson <dyson@FreeBSD.org> | 1996-01-31 02:05:12 +0000 |
|---|---|---|
| committer | John Dyson <dyson@FreeBSD.org> | 1996-01-31 02:05:12 +0000 |
| commit | 56363b79a90c0ff14956efc013858061aa612d0c (patch) | |
| tree | 6be25ebe4e5c5f5f3742fc4272ba499afb7637e7 /sys | |
| parent | c29defb0aa646b8fac5c4a4f0a3e0aec0e9686ac (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/kern/sys_pipe.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 1ebbac3cef6d..653b49536fa9 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.1 1996/01/28 23:38:26 dyson Exp $ + * $Id: sys_pipe.c,v 1.2 1996/01/29 02:57:33 dyson Exp $ */ #ifndef OLD_PIPE @@ -265,8 +265,12 @@ pipe_read(fp, uio, cred) rpipe->pipe_state &= ~PIPE_WANTW; wakeup(rpipe); } - if ((nread > 0) || (rpipe->pipe_state & PIPE_NBIO)) + if (nread > 0) break; + if (rpipe->pipe_state & PIPE_NBIO) { + error = EAGAIN; + break; + } if (rpipe->pipe_peer == NULL) break; @@ -342,7 +346,7 @@ pipe_write(fp, uio, cred) */ if (wpipe == NULL || (wpipe->pipe_state & PIPE_EOF)) { psignal(curproc, SIGPIPE); - return 0; + return EPIPE; } ++wpipe->pipe_busy; @@ -393,7 +397,7 @@ pipe_write(fp, uio, cred) */ if (wpipe->pipe_state & PIPE_EOF) { psignal(curproc, SIGPIPE); - break; + error = EPIPE; } } } |
