Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Feb 2011 07:41:35 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Garrett Cooper <yanegomi@gmail.com>
Subject:   Re: [PATCH] fix impossible case with waitpid(2) in truss
Message-ID:  <201102150741.35265.jhb@freebsd.org>
In-Reply-To: <AANLkTinWcf-Y6=O3MkEwMkN6_E=jos8y2_mrw3Y1ouHa@mail.gmail.com>
References:  <AANLkTinWcf-Y6=O3MkEwMkN6_E=jos8y2_mrw3Y1ouHa@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, February 14, 2011 11:12:02 pm Garrett Cooper wrote:
> Hi,
>     waitpid(2) returns a value in the set { -1, 0, <pid> } (-1 in the
> event of an ERROR, 0 when WNOHANG is specified, <pid> when the process
> exits according to wait(2)); it never returns a value < -1.
>     If someone could commit this patch it would be appreciated.
> Thanks,
> -Garrett

I went with '< 0' to match the style used for ptrace() invocations in other 
parts of truss.  All four calls to waitpid() in truss were broken in this 
fashion.

-- 
John Baldwin



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