Skip site navigation (1)Skip section navigation (2)
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

[-- Attachment #1 --]
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

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)

iD8DBQFGAAGdXY6L6fI4GtQRAumhAJ9FjXiPmxqJpbn3YsiTwMI8M+08tgCgspm3
p19xfdNrZYgKib8iXZYZacA=
=lX/L
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070320154533.GA34961>