Date: Sat, 6 Jan 2007 20:27:32 +0100 (CET) From: Oliver Fromme <olli@lurza.secnetix.de> To: imp@bsdimp.com (M. Warner Losh) Cc: erik.udo@gmail.com, freebsd-hackers@freebsd.org, dougb@freebsd.org Subject: Re: Init.c, making it chroot Message-ID: <200701061927.l06JRWoB095827@lurza.secnetix.de> In-Reply-To: <20070106.113348.353676879.imp@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
M. Warner Losh wrote: > > this patch looks good, however, one nit: > > In message: <200701052106.l05L60a6042599@lurza.secnetix.de> > Oliver Fromme <olli@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701061927.l06JRWoB095827>