From 524a949c7fc53f17198767ecfc29cbc856d6efc6 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 17 Feb 2012 04:46:55 -0600 Subject: Move includes into toys.h, more xprintf() --- toys/free.c | 1 - toys/uptime.c | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/toys/free.c b/toys/free.c index 189107f1..229e5e97 100644 --- a/toys/free.c +++ b/toys/free.c @@ -20,7 +20,6 @@ config FREE */ #include "toys.h" -#include static unsigned long long convert(unsigned long d, unsigned int iscale, unsigned int oscale) diff --git a/toys/uptime.c b/toys/uptime.c index 046b9a29..83fb6b1e 100644 --- a/toys/uptime.c +++ b/toys/uptime.c @@ -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 @@ config UPTIME */ #include "toys.h" -#include -#include void uptime_main(void) { @@ -35,16 +33,16 @@ void uptime_main(void) 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); -- cgit v1.2.3