Noop, just verified it again
on FBSD 4.4 STABLE, this:
int
process_alive(pid)
pid_t pid;
{
while (waitpid(pid, NULL, WNOHANG) < 0 && errno == EINTR)
/* do nothing */;
return kill(pid, 0) == 0;
}
misses a bunch of closed? deleted? usd up pids?
on my client, it stays in 'SMB use SID to enemurate'
but i verified these are not still runnning.
only one that works is this code:
/*
* Invalid argument
*/
if(!pid)
return 0;
*/
for(i=0,ret=1;(i<100) && (ret > 0);i++)
ret = waitpid(pid, NULL, WNOHANG);
return kill(pid, 0) == 0;
Michael Scheidell
Secnap Network Security, LLC
[EMAIL PROTECTED] 1+(561) 368-9561
See updated IT Security News at http://www.fdma.com/
----- Original Message -----
From: "Stefan Esser" <[EMAIL PROTECTED]>
To: "John Rochester" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; "Stefan Esser" <[EMAIL PROTECTED]>
Sent: Tuesday, January 01, 2002 5:25 PM
Subject: Re: Re: userland program panics freebsd 4.3
> On 2002-01-01 19:59 +0000, John Rochester <[EMAIL PROTECTED]> wrote:
> > Stefan Esser wrote:
> >
> > >Instead of the for loop, I'd rather have:
> > >
> > > while(waitpid(pid, NULL, WNOHANG) == EINTR)
> > >
> > This should be
> >
> > while (waitpid(pid, NULL, WNOHANG) < 0 && errno == EINTR)
>
> Yes, obviously ... ;-)
>
> STefan
>
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
>
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message