summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_pipe.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2006-01-30 08:25:04 +0000
committerglebius <glebius@FreeBSD.org>2006-01-30 08:25:04 +0000
commite8ec4c3a0a1ae86c8fba7f646df352de0c0277f1 (patch)
tree3ef2986a9440c15428505e029975cbbfcf82a2b2 /sys/kern/sys_pipe.c
parentaf5f24849498ebe529377266869ca013cdcd0393 (diff)
downloadFreeBSD-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.c5
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;
OpenPOWER on IntegriCloud