From 9c03a8ae91e06e47f0c59996ef0e2300e231e101 Mon Sep 17 00:00:00 2001 From: jhb Date: Tue, 24 Apr 2001 00:51:53 +0000 Subject: Change the pfind() and zpfind() functions to lock the process that they find before releasing the allproc lock and returning. Reviewed by: -smp, dfr, jake --- sys/compat/linux/linux_misc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/compat/linux/linux_misc.c') diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index ffb280c..fe422a9 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -558,10 +558,11 @@ linux_getpgid(struct proc *p, struct linux_getpgid_args *args) if (args->pid != p->p_pid) { if (!(curp = pfind(args->pid))) return ESRCH; + p->p_retval[0] = curp->p_pgid; + PROC_UNLOCK(curp); } else - curp = p; - p->p_retval[0] = curp->p_pgid; + p->p_retval[0] = p->p_pgid; return 0; } -- cgit v1.1