From owner-freebsd-rc@FreeBSD.ORG Tue Mar 20 15:45:36 2007 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12D1B16A400 for ; Tue, 20 Mar 2007 15:45:36 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (grnl-static-02-0046.dsl.iowatelecom.net [69.66.56.110]) by mx1.freebsd.org (Postfix) with ESMTP id BFBD913C4B9 for ; Tue, 20 Mar 2007 15:45:35 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.13.8/8.13.8) with ESMTP id l2KFjYHo035786; Tue, 20 Mar 2007 10:45:34 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.13.8/8.13.8/Submit) id l2KFjXMB035785; Tue, 20 Mar 2007 10:45:33 -0500 (CDT) (envelope-from brooks) Date: Tue, 20 Mar 2007 10:45:33 -0500 From: Brooks Davis To: Sergey Baturov Message-ID: <20070320154533.GA34961@lor.one-eyed-alien.net> References: <20070320151033.A9CF756@gracer.toor.org.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qMm9M+Fa2AknHoGS" Content-Disposition: inline In-Reply-To: <20070320151033.A9CF756@gracer.toor.org.ru> User-Agent: Mutt/1.5.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Tue, 20 Mar 2007 10:45:34 -0500 (CDT) Cc: freebsd-rc@freebsd.org Subject: Re: mountcritlocal and mountlate issue X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2007 15:45:36 -0000 --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 20, 2007 at 06:10:33PM +0300, Sergey Baturov wrote: > Hi, all!=20 >=20 > I've found a small non-critical issue in /etc/rc.d/mountcritlocal > and /etc/rc.d/mountlate scripts. The issue is the same:=20 >=20 > mount -a ... > echo '.'=20 >=20 > case $? in > 0) > ;; > *) > ...=20 >=20 > There is no situation when 'case' would have a value other then '0' > because 'echo' executed just before the 'case' and the last command > exit status will almost always be zero. And the user will never see > error message in '*' case.=20 >=20 > Is this correct?=20 Yes, this is a common mistake. I think the easiest solution is probablly to save $? after the mount call and refer to the saved value. That and replacing the case with an if statement since test will do the job just fine. -- Brooks --qMm9M+Fa2AknHoGS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGAAGdXY6L6fI4GtQRAumhAJ9FjXiPmxqJpbn3YsiTwMI8M+08tgCgspm3 p19xfdNrZYgKib8iXZYZacA= =lX/L -----END PGP SIGNATURE----- --qMm9M+Fa2AknHoGS--