use symbolic names for getloadavg() parameters, stricter error checks;
enable getloadavg() for Linux, a few little cleanups for Linux.
This commit is contained in:
1 parent
f0bcfdb1c4
commit
14087edeb9
7 files changed
+47
-25
No files matched your search
@@ -234,12 +234,12 @@ int machine_get_load(load_type *curr_load)
|
||||
|
||||
int machine_get_loadavg(double *load)
|
||||
{
|
||||
double loadavg[1];
|
||||
double loadavg[LOADAVG_NSTATS];
|
||||
|
||||
if (getloadavg(loadavg, 1) == -1)
|
||||
if (getloadavg(loadavg, LOADAVG_NSTATS) <= LOADAVG_1MIN)
|
||||
return(FALSE);
|
||||
|
||||
*load = loadavg[0];
|
||||
*load = loadavg[LOADAVG_1MIN];
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user