From owner-freebsd-firewire@FreeBSD.ORG Sun Aug 31 20:06:42 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 71ACD10656BE for ; Sun, 31 Aug 2008 20:06:42 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from parsely.rain.com (parsely.rain.com [199.26.172.196]) by mx1.freebsd.org (Postfix) with ESMTP id 98A938FC1A for ; Sun, 31 Aug 2008 20:06:40 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from sopwith.solgatos.com (uucp@localhost) by parsely.rain.com (8.11.4/8.11.4) with UUCP id m7VK6W390340; Sun, 31 Aug 2008 13:06:32 -0700 (PDT) (envelope-from freebsd@sopwith.solgatos.com) Received: from localhost by sopwith.solgatos.com (8.8.8/6.24) id UAA08072; Sun, 31 Aug 2008 20:05:44 GMT Message-Id: <200808312005.UAA08072@sopwith.solgatos.com> In-reply-to: Your message of "Sun, 31 Aug 2008 12:34:34 BST." Date: Sun, 31 Aug 2008 13:05:44 +0100 From: Dieter 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, 31 Aug 2008 20:06:42 -0000 > 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