[Toybox] [CLEANUP] renice
Rob Landley
rob at landley.net
Wed Jul 31 14:37:14 PDT 2013
Commit 978: http://landley.net/hg/toybox/rev/978
Changed option string to require at least one argument and to add the
'|'
indicating -n is required. This let me remove the line checking for -n
in main.
Parenthesized the "which" setting for clarity: the priority of the &
operator is
nonobvious so I prefer to parenthesize it in tests. Also put parentheses
around the second ? : pair so it's clear at a glance which ? goes with
which :.
Switched from an int loop index to a char ** loop index, since
traversing over
optargs is naturally null terminated. Switched from id_t to int for id
since
that's what setpriority takes as an argument anyway.
Simplified the error messages for non-english speakers. Removed the
exitval
setting since error_msg() and friends already set that if it's zero when
they're called. (An error happened, after all.)
Fix the -u test so it doesn't dereference a NULL pointer of the username
lookup fails. Fix the strtol() test so it doesn't treat a non-number
argument
as zero and not notice trailing garbage. Took advantage of the signed
int
to use a negative number to signal failure so they can have a common
error
error case.
Fixed the whitespace: non-functions like if (blah) have a space,
functions
do not have a space before the parentheses.
Rob
1375306634.0
More information about the Toybox
mailing list