[PATCH] fix impossible case with waitpid(2) in truss

John Baldwin jhb at freebsd.org
Tue Feb 15 12:51:48 UTC 2011

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 

John Baldwin

More information about the freebsd-hackers mailing list