summaryrefslogtreecommitdiffstats
path: root/openbsd/Platform.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-11-02 08:46:40 -0500
committerHisham Muhammad <hisham@gobolinux.org>2015-11-02 08:46:40 -0500
commitfd5dd6605adfa15c28eb16c9081e1df977724c78 (patch)
tree378d459d02164efff71e3bef02869b34d8502048 /openbsd/Platform.c
parentb669540e4e5b62f639146f6c373c131319631e6e (diff)
parentcd3d2337f839c496e98ebc8633c1c0c0b961bb66 (diff)
Merge pull request #299 from mmcco/master
OpenBSD port updates and error exit improvements
Diffstat (limited to 'openbsd/Platform.c')
-rw-r--r--openbsd/Platform.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/openbsd/Platform.c b/openbsd/Platform.c
index a961c77e..7114d941 100644
--- a/openbsd/Platform.c
+++ b/openbsd/Platform.c
@@ -38,6 +38,7 @@ in the source distribution for its full text.
/*{
#include "Action.h"
#include "BatteryMeter.h"
+#include "SignalsPanel.h"
extern ProcessFieldData Process_fields[];
@@ -167,7 +168,7 @@ int Platform_getUptime() {
struct timeval bootTime, currTime;
int mib[2] = { CTL_KERN, KERN_BOOTTIME };
size_t size = sizeof(bootTime);
-
+
int err = sysctl(mib, 2, &bootTime, &size, NULL, 0);
if (err) {
return -1;
@@ -181,7 +182,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
struct loadavg loadAverage;
int mib[2] = { CTL_VM, VM_LOADAVG };
size_t size = sizeof(loadAverage);
-
+
int err = sysctl(mib, 2, &loadAverage, &size, NULL, 0);
if (err) {
*one = 0;
@@ -210,8 +211,7 @@ double Platform_setCPUValues(Meter* this, int cpu) {
size_t size = sizeof(double) * CPUSTATES;
int mib[] = { CTL_KERN, KERN_CPTIME2, cpu-1 };
if (sysctl(mib, 3, new_v, &size, NULL, 0) == -1) {
- puts("err!");
- //return 0.;
+ return 0.;
}
// XXX: why?
@@ -232,7 +232,7 @@ double Platform_setCPUValues(Meter* this, int cpu) {
if (perc <= 100. && perc >= 0.) {
return perc;
} else {
- return 12.34;
+ return 0.;
}
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy