summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-04-10 09:07:20 +0000
committerguenther <guenther@openbsd.org>2012-04-10 09:07:20 +0000
commit40ff686becdb5a0a8324cc23e5bc7ddfaa680bbd (patch)
tree584698ee3e697b1b6ae15a1750720a612448426e
parentHandle file descriptor exhaustion in the accept() case. (diff)
downloadwireguard-openbsd-40ff686becdb5a0a8324cc23e5bc7ddfaa680bbd.tar.xz
wireguard-openbsd-40ff686becdb5a0a8324cc23e5bc7ddfaa680bbd.zip
POSIX locks should track the process's pid and not the thread's id
-rw-r--r--sys/kern/vfs_lockf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_lockf.c b/sys/kern/vfs_lockf.c
index a02015ec28e..d406e24addf 100644
--- a/sys/kern/vfs_lockf.c
+++ b/sys/kern/vfs_lockf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_lockf.c,v 1.16 2010/06/29 03:14:42 tedu Exp $ */
+/* $OpenBSD: vfs_lockf.c,v 1.17 2012/04/10 09:07:20 guenther Exp $ */
/* $NetBSD: vfs_lockf.c,v 1.7 1996/02/04 02:18:21 christos Exp $ */
/*
@@ -186,7 +186,7 @@ lf_advlock(struct lockf **head, off_t size, caddr_t id, int op,
lock->lf_next = NULL;
TAILQ_INIT(&lock->lf_blkhd);
lock->lf_flags = flags;
- lock->lf_pid = (flags & F_POSIX) ? curproc->p_pid : -1;
+ lock->lf_pid = (flags & F_POSIX) ? p->p_p->ps_pid : -1;
switch (op) {
case F_SETLK: