summaryrefslogtreecommitdiff
path: root/sys/kern/kern_prot.c
diff options
context:
space:
mode:
authormvs <mvs@cvs.openbsd.org>2021-01-17 15:28:23 +0000
committermvs <mvs@cvs.openbsd.org>2021-01-17 15:28:23 +0000
commit6a4f30308eefd922b7f297530d729f064fc0e517 (patch)
tree8732cd46cbc60c81451796d442406c3dacae919b /sys/kern/kern_prot.c
parent1214f8430a6c6a970a99c0af38ce050234e52714 (diff)
Cache parent's pid as `ps_ppid' and use it instead of `ps_pptr->ps_pid'.
This allows us to unlock getppid(2). ok mpi@
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r--sys/kern/kern_prot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 67c6c1020d5..f6fff9d87bb 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_prot.c,v 1.76 2019/07/09 12:23:25 bluhm Exp $ */
+/* $OpenBSD: kern_prot.c,v 1.77 2021/01/17 15:28:22 mvs Exp $ */
/* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */
/*
@@ -84,7 +84,7 @@ int
sys_getppid(struct proc *p, void *v, register_t *retval)
{
- *retval = p->p_p->ps_pptr->ps_pid;
+ *retval = p->p_p->ps_ppid;
return (0);
}