diff options
-rw-r--r-- | lib/libc/sys/pipe.2 | 4 | ||||
-rw-r--r-- | sys/kern/sys_pipe.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/libc/sys/pipe.2 b/lib/libc/sys/pipe.2 index 247b999..5f5ac3a 100644 --- a/lib/libc/sys/pipe.2 +++ b/lib/libc/sys/pipe.2 @@ -32,7 +32,7 @@ .\" @(#)pipe.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd January 30, 2006 .Dt PIPE 2 .Os .Sh NAME @@ -98,6 +98,8 @@ system call will fail if: Too many descriptors are active. .It Bq Er ENFILE The system file table is full. +.It Bq Er ENOMEM +Not enough kernel memory to establish a pipe. .It Bq Er EFAULT The .Fa fildes diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index a237d97..3b63198 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -357,10 +357,11 @@ pipe(td, uap) NULL); /* Only the forward direction pipe is backed by default */ - if (pipe_create(rpipe, 1) || pipe_create(wpipe, 0)) { + if ((error = pipe_create(rpipe, 1)) != 0 || + (error = pipe_create(wpipe, 0)) != 0) { pipeclose(rpipe); pipeclose(wpipe); - return (ENFILE); + return (error); } rpipe->pipe_state |= PIPE_DIRECTOK; |