diff options
Diffstat (limited to 'uptime.c')
-rw-r--r-- | uptime.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -51,19 +51,19 @@ extern int uptime_main(int argc, char **argv) | |||
51 | 51 | ||
52 | sysinfo(&info); | 52 | sysinfo(&info); |
53 | 53 | ||
54 | fprintf(stdout, " %2d:%02d%s up ", | 54 | printf(" %2d:%02d%s up ", |
55 | current_time->tm_hour%12 ? current_time->tm_hour%12 : 12, | 55 | current_time->tm_hour%12 ? current_time->tm_hour%12 : 12, |
56 | current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am"); | 56 | current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am"); |
57 | updays = (int) info.uptime / (60*60*24); | 57 | updays = (int) info.uptime / (60*60*24); |
58 | if (updays) | 58 | if (updays) |
59 | fprintf(stdout, "%d day%s, ", updays, (updays != 1) ? "s" : ""); | 59 | printf("%d day%s, ", updays, (updays != 1) ? "s" : ""); |
60 | upminutes = (int) info.uptime / 60; | 60 | upminutes = (int) info.uptime / 60; |
61 | uphours = (upminutes / 60) % 24; | 61 | uphours = (upminutes / 60) % 24; |
62 | upminutes %= 60; | 62 | upminutes %= 60; |
63 | if(uphours) | 63 | if(uphours) |
64 | fprintf(stdout, "%2d:%02d, ", uphours, upminutes); | 64 | printf("%2d:%02d, ", uphours, upminutes); |
65 | else | 65 | else |
66 | fprintf(stdout, "%d min, ", upminutes); | 66 | printf("%d min, ", upminutes); |
67 | 67 | ||
68 | printf("load average: %ld.%02ld, %ld.%02ld, %ld.%02ld\n", | 68 | printf("load average: %ld.%02ld, %ld.%02ld, %ld.%02ld\n", |
69 | LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]), | 69 | LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]), |