Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2001 10:59:29 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        current@FreeBSD.org
Subject:   RE: huh? in Selrecord(): what is this for?
Message-ID:  <XFMail.010720105929.jhb@FreeBSD.org>
In-Reply-To: <3B5854E3.B6D9C86D@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 20-Jul-01 Julian Elischer wrote:
> void
> selrecord(selector, sip)
>         struct proc *selector;
>         struct selinfo *sip;
> {
>         struct proc *p;
>         pid_t mypid;
> 
>         mypid = selector->p_pid;
>         if (sip->si_pid == mypid)
>                 return;
>         if (sip->si_pid && (p = pfind(sip->si_pid))) {
> 
> 
> Why do we look up 'p' when we got it as an argument?
> (race condition detection?)

Err, we look up p when the selector pid isn't the pid in the selinfo.  I.e.,
when we _didn't_ get p as an argument.
 
-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010720105929.jhb>