diff options
Diffstat (limited to 'src/kernel/pipe.c')
-rw-r--r-- | src/kernel/pipe.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kernel/pipe.c b/src/kernel/pipe.c index 6325369..b7f5ad3 100644 --- a/src/kernel/pipe.c +++ b/src/kernel/pipe.c @@ -1,3 +1,4 @@ +#include <camellia/errno.h> #include <kernel/panic.h> #include <kernel/pipe.h> #include <kernel/util.h> @@ -8,7 +9,7 @@ void pipe_joinqueue(Handle *h, Proc *proc, void __user *pbuf, size_t pbuflen) { assert(h && h->type == HANDLE_PIPE); assert(h->readable ^ h->writeable); if (!h->pipe.sister) { - regs_savereturn(&proc->regs, -1); + regs_savereturn(&proc->regs, h->readable ? 0 : -EPIPE); return; } |