[Toybox] Resubmission of free and uptime

Rob Landley rob at landley.net
Thu Feb 16 19:38:17 PST 2012


On 02/13/2012 10:18 AM, Elie De Brauwer wrote:
> Hi all,
> 
> While digging deeper into the USE_xxx(NEWTOY() macro I just found out I
> made a copy paste error while creating free and uptime, hence in attach
> a patch containing my two earlier patches of free and uptime but now
> using USE_FREE and USE_UPTIME.

Sorry for the delay, trying to get to at least one toybox thing a day...

free: looks good.  Cleanups: printf->xprintf(), swapping spaces for tabs
(and bigger printf padding constants) to save a couple bytes.

This is a fairly idiosyncratic command, is there a spec for it anywhere?
 (Not susv4...)  The gnu/dammit version seems to default to kilobytes
instead of bytes, but doesn't have any indicator of this in the output...

(I'm actually slightly torn over the xprintf() because the other
versions don't exit with an error when you do "free > /dev/full"... but
I think they probably _should_...)

Rob

P.S. I say "gnu/dammit" because the FSF guys keep insisting "It's
gnu/linux/dammit", so I'm guessing both halves of the bracket are part
of the full name when they're referring to the Linux versions of their
software.  At a guess, "gnu/solaris/dammit" is the name of their Indiana
binaries, and "gnu/macosx/dammit" for the ports to that platform...

P.P.S. Well, maybe a _little_ bitter.



More information about the Toybox mailing list