aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/free.c1
-rw-r--r--toys/uptime.c10
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 <sys/sysinfo.h>
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 <eliedebrauwer@gmail.com>
*
- * 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 <sys/sysinfo.h>
-#include <time.h>
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);