summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2011-07-08 19:00:09 +0000
committertedu <tedu@openbsd.org>2011-07-08 19:00:09 +0000
commit8416c63df4180076257bd24cd0f86bac0eb9740a (patch)
treed6f089c80ea4d06babf6c2ed19233880d9fc1632
parentxl(4) now supports WoL. (diff)
downloadwireguard-openbsd-8416c63df4180076257bd24cd0f86bac0eb9740a.tar.xz
wireguard-openbsd-8416c63df4180076257bd24cd0f86bac0eb9740a.zip
keep the fdplock around copyout in pipe. ok matthew
-rw-r--r--sys/kern/sys_pipe.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index ae9961f457d..a3edd7cf7cf 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_pipe.c,v 1.60 2011/07/08 05:01:27 matthew Exp $ */
+/* $OpenBSD: sys_pipe.c,v 1.61 2011/07/08 19:00:09 tedu Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
@@ -144,15 +144,12 @@ sys_pipe(struct proc *p, void *v, register_t *retval)
FILE_SET_MATURE(rf);
FILE_SET_MATURE(wf);
- fdpunlock(fdp);
-
error = copyout(fds, SCARG(uap, fdp), sizeof(fds));
if (error != 0) {
- fdplock(fdp);
fdrelease(p, fds[0]);
fdrelease(p, fds[1]);
- fdpunlock(fdp);
}
+ fdpunlock(fdp);
return (error);
free3: