From owner-freebsd-current Mon Mar 17 14:28:21 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A5CF237B401; Mon, 17 Mar 2003 14:28:19 -0800 (PST) Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B3D143F85; Mon, 17 Mar 2003 14:28:18 -0800 (PST) (envelope-from crist.clark@attbi.com) Received: from blossom.cjclark.org (12-234-89-252.client.attbi.com[12.234.89.252]) by sccrmhc01.attbi.com (sccrmhc01) with ESMTP id <2003031722281700100eq6i9e>; Mon, 17 Mar 2003 22:28:17 +0000 Received: from blossom.cjclark.org (localhost. [127.0.0.1]) by blossom.cjclark.org (8.12.6/8.12.3) with ESMTP id h2HMSGeq099537; Mon, 17 Mar 2003 14:28:16 -0800 (PST) (envelope-from crist.clark@attbi.com) Received: (from cjc@localhost) by blossom.cjclark.org (8.12.6/8.12.6/Submit) id h2HMSFtZ099536; Mon, 17 Mar 2003 14:28:15 -0800 (PST) X-Authentication-Warning: blossom.cjclark.org: cjc set sender to crist.clark@attbi.com using -f Date: Mon, 17 Mar 2003 14:28:15 -0800 From: "Crist J. Clark" To: "David O'Brien" , current@FreeBSD.org Subject: Re: Create linker.hints at boot Message-ID: <20030317222815.GB98963@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <20030315000920.GA69495@blossom.cjclark.org> <20030315032742.3AE132A7EA@canning.wemm.org> <20030317082834.GC24317@blossom.cjclark.org> <20030317171112.GA32128@dragon.nuxi.com> <20030317204319.GA98963@blossom.cjclark.org> <20030317210753.GA35762@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030317210753.GA35762@dragon.nuxi.com> User-Agent: Mutt/1.4i X-URL: http://people.freebsd.org/~cjc/ Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Mar 17, 2003 at 01:07:53PM -0800, David O'Brien wrote: > On Mon, Mar 17, 2003 at 12:43:19PM -0800, Crist J. Clark wrote: > > On Mon, Mar 17, 2003 at 09:11:12AM -0800, David O'Brien wrote: > > > On Mon, Mar 17, 2003 at 12:28:34AM -0800, Crist J. Clark wrote: > > > > +kldxref_start () { > > > > + if [ -z "$kldxref_module_path" ]; then > > > > + MODULE_PATHS=`sysctl -n kern.module_path` > > > > + else > > > > + MODULE_PATHS="$kldxref_module_path" > > > > + fi > > > > > > Please change the logic to positive logic: > > > > > > if [ -n "$kldxref_module_path" ]; then > > > MODULE_PATHS="$kldxref_module_path" > > > else > > > MODULE_PATHS=`sysctl -n kern.module_path` > > > fi > > > > Is there a technical reason for that or is it just a "style" issue? > > Style, easier to read out loud, easier to understand w/o having to think. > Just like this is hard to "read". It certainly doesn't do what one reads > out loud: "if not string compaire equal". > > if (!strcmp(a,b) { > printf("same\n"); > } I don't see what that code snipit has to do with the script (but I am in the camp that would go ahead and waste the four bytes of source code to write that as (strcmp(a, b) == 0)). I _did_ write the original script the way I was thinking/would say it, "If $kldxref_module_path is empty, use the sysctl(8), otherwise, use its contents." I guess I was thinking of '-z' as a positive, "is empty," rather than a negative, "is not filled." But whatever. I've changed it to the "positive" in my repository. I'll commit the latest version later and everyone can make there own fixes/additions/changes/PRs. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message