# HG changeset patch # User Rob Landley # Date 1329475615 21600 # Node ID 77f590d2cad96b7d99eacdd546a0a59de4e938cf # Parent 2d50fee68ca1bcf3e64bbe834cdb9731ca9463d8 Move includes into toys.h, more xprintf() diff -r 2d50fee68ca1 -r 77f590d2cad9 toys/free.c --- a/toys/free.c Thu Feb 16 17:51:51 2012 -0600 +++ b/toys/free.c Fri Feb 17 04:46:55 2012 -0600 @@ -20,7 +20,6 @@ */ #include "toys.h" -#include static unsigned long long convert(unsigned long d, unsigned int iscale, unsigned int oscale) diff -r 2d50fee68ca1 -r 77f590d2cad9 toys/uptime.c --- a/toys/uptime.c Thu Feb 16 17:51:51 2012 -0600 +++ b/toys/uptime.c Fri Feb 17 04:46:55 2012 -0600 @@ -4,7 +4,7 @@ * * Copyright 2012 Elie De Brauwer * - * Not in SUSv3. + * Not in SUSv4. USE_UPTIME(NEWTOY(uptime, NULL, TOYFLAG_USR|TOYFLAG_BIN)) @@ -19,8 +19,6 @@ */ #include "toys.h" -#include -#include void uptime_main(void) { @@ -35,16 +33,16 @@ now = localtime(&tmptime); // Time - printf(" %02d:%02d:%02d up ", now->tm_hour, now->tm_min, now->tm_sec); + xprintf(" %02d:%02d:%02d up ", now->tm_hour, now->tm_min, now->tm_sec); // Uptime info.uptime /= 60; minutes = info.uptime%60; info.uptime /= 60; hours = info.uptime%24; days = info.uptime/24; - if (days) printf("%d day%s, ", days, (days!=1)?"s":""); + if (days) xprintf("%d day%s, ", days, (days!=1)?"s":""); if (hours) - printf("%2d:%02d, ", hours, minutes); + xprintf("%2d:%02d, ", hours, minutes); else printf("%d min, ", minutes);