Init.c, making it chroot

Oliver Fromme olli at lurza.secnetix.de
Sat Jan 6 19:27:49 UTC 2007


M. Warner Losh wrote:
 > 
 > this patch looks good, however, one nit:
 > 
 > In message: <200701052106.l05L60a6042599 at lurza.secnetix.de>
 >             Oliver Fromme <olli at lurza.secnetix.de> writes:
 > : +		if (stat("/dev", &stst) != 0)
 > : +			warning("Can't stat /dev: %m");
 > : +		else {
 > : +			if (stst.st_dev == root_devno)
 > : +				devfs++;
 > : +		}
 > 
 > is more succinctly expressed as:
 > 
 > +		if (stat("/dev", &stst) != 0)
 > +			warning("Can't stat /dev: %m");
 > +		else if (stst.st_dev == root_devno)
 > +				devfs++;

Agreed.  I thought style(9) would forbid nesting "else if"
like that, but I was wrong.

 > Also, kenv(KENV_GET, ... is used a lot.  Maybe it makes sense to have
 > a simple kenvget call.  Would make a few lines a little shorter if
 > nothing else.

KENV_GET is used three times.  Using a wrapper function
would save 7 characters per call.  I don't think it's
really worth it.  But if you insist, I can update the
patch with such a function.

By the way, how about declaring requested_transition
volatile, as explained in my previus mail?

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

cat man du : where Unix geeks go when they die


More information about the freebsd-hackers mailing list