mirror of
https://github.com/opnsense/src.git
synced 2026-03-09 01:30:47 -04:00
Just use the proc lock to protect read accesses to p_pptr rather than the
more expensive proctree lock.
This commit is contained in:
parent
8d2725181a
commit
bae3a80b16
1 changed files with 4 additions and 4 deletions
|
|
@ -79,9 +79,9 @@ getpid(p, uap)
|
|||
|
||||
p->p_retval[0] = p->p_pid;
|
||||
#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
|
||||
PROCTREE_LOCK(PT_SHARED);
|
||||
PROC_LOCK(p);
|
||||
p->p_retval[1] = p->p_pptr->p_pid;
|
||||
PROCTREE_LOCK(PT_RELEASE);
|
||||
PROC_UNLOCK(p);
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
|
|
@ -102,9 +102,9 @@ getppid(p, uap)
|
|||
struct getppid_args *uap;
|
||||
{
|
||||
|
||||
PROCTREE_LOCK(PT_SHARED);
|
||||
PROC_LOCK(p);
|
||||
p->p_retval[0] = p->p_pptr->p_pid;
|
||||
PROCTREE_LOCK(PT_RELEASE);
|
||||
PROC_UNLOCK(p);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue