diff options
author | glebius <glebius@FreeBSD.org> | 2006-01-30 08:25:04 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2006-01-30 08:25:04 +0000 |
commit | e8ec4c3a0a1ae86c8fba7f646df352de0c0277f1 (patch) | |
tree | 3ef2986a9440c15428505e029975cbbfcf82a2b2 /sys/kern/sys_pipe.c | |
parent | af5f24849498ebe529377266869ca013cdcd0393 (diff) | |
download | FreeBSD-src-e8ec4c3a0a1ae86c8fba7f646df352de0c0277f1.zip FreeBSD-src-e8ec4c3a0a1ae86c8fba7f646df352de0c0277f1.tar.gz |
- In pipe() return the error returned by pipe_create(), rather then
hardcoded ENFILES, which is incorrect. pipe_create() can fail due
to ENOMEM.
- Update manual page, describing ENOMEM return code.
Reviewed by: arch
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r-- | sys/kern/sys_pipe.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |