Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Jul 2009 17:05:11 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@freebsd.org, Xin LI <delphij@freebsd.org>, svn-src-all@freebsd.org, src-committers@freebsd.org, d@delphij.net
Subject:   Re: svn commit: r194789 - head/usr.bin/usbhidctl
Message-ID:  <86iqica1g8.fsf@ds4.des.no>
In-Reply-To: <20090701214927.V39172@delplex.bde.org> (Bruce Evans's message of "Wed, 1 Jul 2009 22:19:58 %2B1000 (EST)")
References:  <200906232316.n5NNG1iT094289@svn.freebsd.org> <20090625154007.H33864@delplex.bde.org> <4A43B727.7010204@delphij.net> <20090627033608.P35379@delplex.bde.org> <8663ed2265.fsf@ds4.des.no> <20090701214927.V39172@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans <brde@optusnet.com.au> writes:
> "Dag-Erling Sm=C3=B8rgrav" <des@des.no> writes:
> > BTW, there are numerous style issues in sbin/reboot/reboot.c.
> Really?  According to knfom, it is 94.772% knf (up from 94.520% in
> ~5.2 and 92.896% in Lite2).  It is a small program so it is easy to
> get right, but anything above 90% is a nice colour.  (94.520% is due
> to 7 lines fixed by indent(1) and 5 lines broken by indent(1)).

I guess it depends on your definition of "numerous".

The most obvious ones (since I was looking at usage()) were the missing
void in the definition of usage() and the missing blank line at the top
of the function.  Other than that: #include directives are unordered,
local variables in main() are declared in the wrong order, geteuid() is
used as a predicate, and the required parentheses around the return
value in get_pageins() are missing.

I would also use fopen(3) and fprintf(3) instead of open(2) and write(2)
to write nextboot.conf, and I would check that argc is 0 after the
getopt(3) loop.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



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