diff options
author | Martin "eto" Misuth <et.code@ethome.sk> | 2015-10-06 14:04:22 +0200 |
---|---|---|
committer | Martin "eto" Misuth <et.code@ethome.sk> | 2015-10-06 14:04:22 +0200 |
commit | 23798359102a70c662d095722c96229b605175dc (patch) | |
tree | 83db8af90e68ccf706c6cb4992c6573cc3709dac /linux | |
parent | 86417e415743ab2ba8feaa83ba303039ea10a012 (diff) |
Added platform dependent DEFAULT_SIGNAL define, for now for:
FreeBSD
Linux
Other platforms will have it undefined for now.
Diffstat (limited to 'linux')
-rw-r--r-- | linux/Platform.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/linux/Platform.c b/linux/Platform.c index e0f06d6d..92ca64c4 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -32,6 +32,11 @@ in the source distribution for its full text. #include "BatteryMeter.h" #include "LinuxProcess.h" #include "SignalsPanel.h" + +#ifndef DEFAULT_SIGNAL +#define DEFAULT_SIGNAL 16 +#endif + }*/ ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; @@ -176,14 +181,14 @@ double Platform_setCPUValues(Meter* this, int cpu) { percent = v[0]+v[1]+v[2]+v[3]+v[4]+v[5]+v[6]; } else { percent = v[0]+v[1]+v[2]+v[3]+v[4]; - } + } } else { v[2] = cpuData->systemAllPeriod / total * 100.0; v[3] = (cpuData->stealPeriod + cpuData->guestPeriod) / total * 100.0; Meter_setItems(this, 4); percent = v[0]+v[1]+v[2]+v[3]; } - percent = MIN(100.0, MAX(0.0, percent)); + percent = MIN(100.0, MAX(0.0, percent)); if (isnan(percent)) percent = 0.0; return percent; } |