70 |
|
|
71 |
(void) time(&t); |
(void) time(&t); |
72 |
tm = *localtime(&t); |
tm = *localtime(&t); |
73 |
(void) strftime(buff, sizeof(buff), "%R, %d/%m/%Y %Z", &tm); |
(void) strftime(buff, sizeof(buff), "%R, %m/%d/%Y %Z", &tm); |
74 |
|
|
75 |
output("~WSystem time: ~w%s\n", buff); |
output("~WSystem time: ~w%s\n", buff); |
76 |
|
|
92 |
|
|
93 |
while (fread((char *) &utmp_str, sizeof(utmp_str), 1, utmp_file) == 1) |
while (fread((char *) &utmp_str, sizeof(utmp_str), 1, utmp_file) == 1) |
94 |
{ |
{ |
95 |
if (!strcmp(utmp_str.ut_name, "reboot")) |
if (!strcmp(utmp_str.ut_user, "reboot")) |
96 |
boottime = (time_t) utmp_str.ut_time; |
boottime = (time_t) utmp_str.ut_time; |
97 |
} |
} |
98 |
|
|
99 |
if (!boottime) |
if (!boottime) |
100 |
errx(1, "d_uptime"); |
errx(1, "d_uptime"); |