summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exit.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_exit.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_exit.c')
-rw-r--r--sys/kern/kern_exit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 4738000e10d..89326bd6fbc 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.193 2020/12/09 18:58:19 mpi Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.194 2021/01/17 15:28:21 mvs Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -694,6 +694,7 @@ process_reparent(struct process *child, struct process *parent)
}
child->ps_pptr = parent;
+ child->ps_ppid = parent->ps_pid;
}
void