Commit b62058ea authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Cleaned up load function

parent 14b36345
......@@ -97,21 +97,6 @@ static void logmsg(const char* format, ...)
/* Function to grab the load average */
static float getload() {
float loadavgn = -1.00;
#ifdef __FreeBSD__
long total;
struct loadavg sysload;
size_t size = sizeof(sysload);
static int mib[] = {CTL_VM, VM_LOADAVG};
if (sysctl(mib, 2, &sysload, &size, NULL, 0) < 0) {
(void) fprintf(stderr, "top: sysctl failed: %s\n", strerror(errno));
bzero(&total, sizeof(total));
}
loadavgn = ((double) sysload.ldavg[0]) / sysload.fscale;
#else
char buf[1024];
char *pos;
int fd;
......@@ -127,7 +112,6 @@ static float getload() {
}
}
#endif
return loadavgn;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment