Date: Tue, 20 Mar 2007 10:45:33 -0500 From: Brooks Davis <brooks@freebsd.org> To: Sergey Baturov <sergey@toor.org.ru> Cc: freebsd-rc@freebsd.org Subject: Re: mountcritlocal and mountlate issue Message-ID: <20070320154533.GA34961@lor.one-eyed-alien.net> In-Reply-To: <20070320151033.A9CF756@gracer.toor.org.ru> References: <20070320151033.A9CF756@gracer.toor.org.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070320154533.GA34961>