mirror of
https://github.com/aristocratos/btop.git
synced 2024-05-29 16:50:20 +12:00
fix boottime (not sure if needed)
This commit is contained in:
parent
cc2a4987ef
commit
235c95274f
|
@ -24,6 +24,7 @@ tab-size = 4
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <netinet/tcp_fsm.h>
|
#include <netinet/tcp_fsm.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <sys/_timeval.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/statvfs.h>
|
#include <sys/statvfs.h>
|
||||||
|
@ -134,9 +135,12 @@ namespace Shared {
|
||||||
}
|
}
|
||||||
totalMem = memsize;
|
totalMem = memsize;
|
||||||
|
|
||||||
size = sizeof(bootTime);
|
struct timeval result;
|
||||||
if (sysctlbyname("kern.boottime", &bootTime, &size, NULL, 0) < 0) {
|
size = sizeof(result);
|
||||||
Logger::warning("Could not get boot time size");
|
if (sysctlbyname("kern.boottime", &result, &size, NULL, 0) < 0) {
|
||||||
|
Logger::warning("Could not get boot time");
|
||||||
|
} else {
|
||||||
|
bootTime = result.tv_sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
//* Get maximum length of process arguments
|
//* Get maximum length of process arguments
|
||||||
|
|
Loading…
Reference in a new issue