From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 15 14:12:06 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3467D1065672; Tue, 15 Feb 2011 14:12:06 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 967BB8FC0A; Tue, 15 Feb 2011 14:12:05 +0000 (UTC) Received: by wwf26 with SMTP id 26so211594wwf.31 for ; Tue, 15 Feb 2011 06:12:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=cMH43oHxOim1+sNRsd4hDzBzbMyLZ2MeXQCD99chhf0=; b=EQ14AwNyc/oKIbo1BJtd4Kw4DsuVS/XFh/hNElHpbkIQY7pROcv/Hh6QZ+hQsjlGUl NJk8XLz45Wms3JXXuid7DuAwOZJK9NmGYb4HhrxEbJxbLykHUf3QGJlFvwRxwkcfdt6L 3quZcxXa7iK0ig1f1mRMYUwqBq6TtZxIXGLmY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=k3NkejvXIFyt5hwh5LQY5UeldjpS4bci7cBClgNXxN/wNcejfKGhwk8HDhsz0Azfx5 fz6K43oiY5QSz/pcINMFxJbWJfzhPlLJ49mmBzb1DPHQk5XfyqJ/6xOM1XwhfZM5i7Kx 7HxyBWXYZMxbcuCE+9XBkyc3Ojf94IyVDoLjc= MIME-Version: 1.0 Received: by 10.216.63.138 with SMTP id a10mr1822852wed.27.1297779124453; Tue, 15 Feb 2011 06:12:04 -0800 (PST) Received: by 10.216.71.200 with HTTP; Tue, 15 Feb 2011 06:12:04 -0800 (PST) In-Reply-To: <201102150741.35265.jhb@freebsd.org> References: <201102150741.35265.jhb@freebsd.org> Date: Tue, 15 Feb 2011 06:12:04 -0800 Message-ID: From: Garrett Cooper To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] fix impossible case with waitpid(2) in truss X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 14:12:06 -0000 On Tue, Feb 15, 2011 at 4:41 AM, John Baldwin 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, } (-1 in th= e >> event of an ERROR, 0 when WNOHANG is specified, 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