diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2006-01-30 08:25:04 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2006-01-30 08:25:04 +0000 |
commit | 61fb9bd80c721bf26694235d79f325c8df0191c2 (patch) | |
tree | 3ef2986a9440c15428505e029975cbbfcf82a2b2 /sys | |
parent | 3b77d80cdd39da86a4fdb6cbd3fcbe786b55e38b (diff) | |
download | src-61fb9bd80c721bf26694235d79f325c8df0191c2.tar.gz src-61fb9bd80c721bf26694235d79f325c8df0191c2.zip |
- 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
Notes
Notes:
svn path=/head/; revision=155035
Diffstat (limited to 'sys')
-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 a237d979408e..3b631988d4bf 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; |