aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2006-01-30 08:25:04 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2006-01-30 08:25:04 +0000
commit61fb9bd80c721bf26694235d79f325c8df0191c2 (patch)
tree3ef2986a9440c15428505e029975cbbfcf82a2b2 /sys
parent3b77d80cdd39da86a4fdb6cbd3fcbe786b55e38b (diff)
downloadsrc-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.c5
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;