mountcritlocal and mountlate issue

Sergey Baturov sergey at toor.org.ru
Tue Mar 20 19:20:21 UTC 2007


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 
show error message to the user. :-)

--
Sergey Baturov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20070320/aff920c3/attachment.pgp


More information about the freebsd-rc mailing list