In:
void os::Posix::print_uptime_info(outputStream* st) {
int bootsec = -1;
time_t currsec = time(nullptr);
struct utmpx* ent;
setutxent();
while ((ent = getutxent())) {
if (!strcmp("system boot", ent->ut_line)) {
bootsec = ent->ut_tv.tv_sec;
break;
}
}
if (bootsec != -1) {
os::print_dhm(st, "OS uptime:", currsec-bootsec);
}
}
we have:
bootsec = ent->ut_tv.tv_sec;
where bootsec is an int, but tv_sec is long.
void os::Posix::print_uptime_info(outputStream* st) {
int bootsec = -1;
time_t currsec = time(nullptr);
struct utmpx* ent;
setutxent();
while ((ent = getutxent())) {
if (!strcmp("system boot", ent->ut_line)) {
bootsec = ent->ut_tv.tv_sec;
break;
}
}
if (bootsec != -1) {
os::print_dhm(st, "OS uptime:", currsec-bootsec);
}
}
we have:
bootsec = ent->ut_tv.tv_sec;
where bootsec is an int, but tv_sec is long.