From owner-freebsd-current@FreeBSD.ORG Wed May 23 08:35:59 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0501016A400 for ; Wed, 23 May 2007 08:35:59 +0000 (UTC) (envelope-from rse@engelschall.com) Received: from visp1.engelschall.com (visp1.engelschall.com [195.30.6.144]) by mx1.freebsd.org (Postfix) with ESMTP id BF5D213C43E for ; Wed, 23 May 2007 08:35:58 +0000 (UTC) (envelope-from rse@engelschall.com) Received: by visp1.engelschall.com (Postfix, from userid 21100) id DF1871B44881; Wed, 23 May 2007 10:21:17 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v0.5.2 visp1.engelschall.com DF1871B44881 Received: by en1.engelschall.com (Postfix, from userid 10000) id 83D826D86F; Wed, 23 May 2007 10:17:49 +0200 (CEST) Date: Wed, 23 May 2007 10:17:49 +0200 From: "Ralf S. Engelschall" To: current@FreeBSD.org Message-ID: <20070523081749.GA18197@engelschall.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: FreeBSD User-Agent: Mutt/1.5.15 OpenPKG/CURRENT (2007-04-06) Cc: Subject: etc/rc.d/{var,tmp} and sub-shell usage?! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Ralf S. Engelschall" List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2007 08:35:59 -0000 I've just stumbled over a confusing sub-shell usage in our src/etc/rc.d/{var,tmp} scripts where I'm sure the sub-shells are totally unnecessary and useless. I also do not see any difference under run-time except that the sub-shell usage is slower, of course ;-) Nevertheless, I'm a little bit curious whether someone else sees _ANY_ reason to keep those sub-shell constructs? If nobody has any objections I would just cleanup these two scripts by removing the sub-shell constructs... Index: tmp =================================================================== RCS file: /v/freebsd/cvs/src/etc/rc.d/tmp,v retrieving revision 1.37 diff -u -d -r1.37 tmp --- tmp 2 Dec 2005 20:35:23 -0000 1.37 +++ tmp 22 May 2007 14:18:48 -0000 @@ -48,7 +48,7 @@ [Nn][Oo]) ;; *) - if (/bin/mkdir -p /tmp/.diskless 2> /dev/null); then + if /bin/mkdir -p /tmp/.diskless 2> /dev/null; then rmdir /tmp/.diskless else if [ -h /tmp ]; then Index: var =================================================================== RCS file: /v/freebsd/cvs/src/etc/rc.d/var,v retrieving revision 1.42 diff -u -d -r1.42 var --- var 2 Apr 2007 22:53:07 -0000 1.42 +++ var 22 May 2007 14:18:09 -0000 @@ -60,7 +60,7 @@ [Nn][Oo]) ;; *) - if (/bin/mkdir -p /var/.diskless 2> /dev/null); then + if /bin/mkdir -p /var/.diskless 2> /dev/null; then rmdir /var/.diskless else mount_md ${varsize} /var "${varmfs_flags}" -- rse@FreeBSD.org Ralf S. Engelschall FreeBSD.org/~rse rse@engelschall.com FreeBSD committer www.engelschall.com