From 6a4f30308eefd922b7f297530d729f064fc0e517 Mon Sep 17 00:00:00 2001 From: mvs Date: Sun, 17 Jan 2021 15:28:23 +0000 Subject: 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@ --- sys/kern/kern_exit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/kern/kern_exit.c') 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 -- cgit v1.2.3