Date: Tue, 15 Feb 2011 06:12:04 -0800 From: Garrett Cooper <yanegomi@gmail.com> To: John Baldwin <jhb@freebsd.org> Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] fix impossible case with waitpid(2) in truss Message-ID: <AANLkTim3w-qqh8aoucd10JYYo1bn%2BcwEYyHakUf5Zfc2@mail.gmail.com> In-Reply-To: <201102150741.35265.jhb@freebsd.org> References: <AANLkTinWcf-Y6=O3MkEwMkN6_E=jos8y2_mrw3Y1ouHa@mail.gmail.com> <201102150741.35265.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 15, 2011 at 4:41 AM, John Baldwin <jhb@freebsd.org> wrote: > On Monday, February 14, 2011 11:12:02 pm Garrett Cooper wrote: >> Hi, >> =A0 =A0 waitpid(2) returns a value in the set { -1, 0, <pid> } (-1 in th= e >> event of an ERROR, 0 when WNOHANG is specified, <pid> when the process >> exits according to wait(2)); it never returns a value < -1. >> =A0 =A0 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 oth= er > parts of truss. =A0All four calls to waitpid() in truss were broken in th= is > fashion. Oops. I just spotted the one issue because I was looking for a reasonable example for how to do ptrace as I needed to clean off some related cobwebs for $JOB. Thanks for finding the rest of the issues! -Garrett
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTim3w-qqh8aoucd10JYYo1bn%2BcwEYyHakUf5Zfc2>