summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2001-12-02 18:07:33 +0000
committerNiels Provos <provos@cvs.openbsd.org>2001-12-02 18:07:33 +0000
commitbcd7ec3916095b6af3bc9e781d2d527ae2e2085d (patch)
tree0ac8d24b58d1a1e304c1927e9adac0a8bd6ff8d6 /sys/kern
parent01a04d7c4081fad6f9f29f0149b9fcd687e257bd (diff)
release the right descriptors when pipe fails; bug report from
marcodsl@swbell.net
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_syscalls.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 3649e68a052..8256c752cd6 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_syscalls.c,v 1.45 2001/11/28 13:49:08 provos Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.46 2001/12/02 18:07:32 provos Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
@@ -884,10 +884,7 @@ sys_getsockopt(p, v, retval)
}
int
-sys_pipe(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
+sys_pipe(struct proc *p, void *v, register_t *retval)
{
register struct sys_pipe_args /* {
syscallarg(int *) fdp;
@@ -903,8 +900,8 @@ sys_pipe(p, v, retval)
error = copyout((caddr_t)fds, (caddr_t)SCARG(uap, fdp),
2 * sizeof (int));
if (error) {
- fdrelease(p, retval[0]);
- fdrelease(p, retval[1]);
+ fdrelease(p, fds[0]);
+ fdrelease(p, fds[1]);
}
return (error);
}