Date: Tue, 20 Mar 2007 21:50:16 +0300 From: Sergey Baturov <sergey@toor.org.ru> To: Brooks Davis <brooks@freebsd.org> Cc: freebsd-rc@freebsd.org Subject: Re: mountcritlocal and mountlate issue Message-ID: <200703202150.23347.sergey@toor.org.ru> In-Reply-To: <20070320154533.GA34961@lor.one-eyed-alien.net> References: <20070320151033.A9CF756@gracer.toor.org.ru> <20070320154533.GA34961@lor.one-eyed-alien.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart2754123.tiNoKamPXr Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tue March 20 2007 18:45, Brooks Davis wrote: > On Tue, Mar 20, 2007 at 06:10:33PM +0300, Sergey Baturov wrote: > > Hi, all! > > > > I've found a small non-critical issue in /etc/rc.d/mountcritlocal > > and /etc/rc.d/mountlate scripts. The issue is the same: > > > > mount -a ... > > echo '.' > > > > case $? in > > 0) > > ;; > > *) > > ... > > > > 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. > > > > Is this correct? > > 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 Will this mistake be fixed in -current and/or -stable? I guess it is useful= to=20 show error message to the user. :-) =2D- Sergey Baturov --nextPart2754123.tiNoKamPXr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQBGACzvibUEe+eSHQgRAlGxAJ9JxdLsf6wltUZOieVUf8AV3DCCcwCgiebt 8NqimExLOqb7kIP6bMAMnNA= =0S6Q -----END PGP SIGNATURE----- --nextPart2754123.tiNoKamPXr--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703202150.23347.sergey>