From owner-freebsd-firewire@FreeBSD.ORG Sun Sep 7 02:20:36 2008 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EAE11065674 for ; Sun, 7 Sep 2008 02:20:36 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 821198FC21 for ; Sun, 7 Sep 2008 02:20:36 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 933F71A9182; Sat, 6 Sep 2008 19:19:40 -0700 (PDT) X-Virus-Scanned: amavisd-new at X-Spam-Flag: NO X-Spam-Score: -4.399 X-Spam-Level: X-Spam-Status: No, score=-4.399 tagged_above=-10 required=6.6 tests=[ALL_TRUSTED=-1.8, BAYES_00=-2.599] Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dWQESnfgsxZq; Sat, 6 Sep 2008 19:19:40 -0700 (PDT) Received: from [10.47.1.6] (vpn.office.miralink.com [10.0.0.5]) by plato.miralink.com (Postfix) with ESMTP id 22F5B1A90D1; Sat, 6 Sep 2008 19:19:40 -0700 (PDT) Message-ID: <48C33A73.80504@miralink.com> Date: Sat, 06 Sep 2008 19:20:35 -0700 From: Sean Bruno User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: Dieter References: <200808312005.UAA08072@sopwith.solgatos.com> In-Reply-To: <200808312005.UAA08072@sopwith.solgatos.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-firewire@freebsd.org Subject: Re: New and improved? patch X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Sep 2008 02:20:36 -0000 Dieter wrote: >> 7.0 AMD64 # ./fwcontrol -f -5 >> fwcontrol: main:set_root_node out of range: No such file or directory >> >> "No such file or directory" seems wrong >> > > err(EX_USAGE, "%s:set_root_node out of range", __func__); > > Err() is correct for places where errno would be set, such as > checking the return code from read(2). But for the range checks, > errno does not apply, so err() gives misleading results. > > The err(3) man page isn't clear, but it looks like errx(3) is > the function you want for the range checks. > > Changing err() to errx() gives: > > 7.0 AMD64 # ./fwcontrol -f 70 > fwcontrol: main:set_root_node out of range > Yup. I completely agree here. -- Sean Bruno MiraLink Corporation 6015 NE 80th Ave, Ste 100 Portland, OR 97218 Cell 503-358-6832 Phone 503-621-5143 Fax 503-621-5199 MSN: sbruno@miralink.com Google: seanwbruno@gmail.com