summaryrefslogtreecommitdiffstats
path: root/netbsd
diff options
context:
space:
mode:
authorfraggerfox <santhosh.raju@gmail.com>2021-04-09 08:24:02 +0530
committerBenBE <BenBE@geshi.org>2021-06-26 12:18:37 +0200
commit440bb87058fc591175c970b4d5f5c36aa957942d (patch)
tree504ef3f8e684fff7bfc2daf65fdcd55f95afee79 /netbsd
parentdb986236843ac87c89ea74cd13ab4aa8d90cf935 (diff)
Minor code clean up and corrections.
Diffstat (limited to 'netbsd')
-rw-r--r--netbsd/Platform.c58
-rw-r--r--netbsd/ProcessField.h2
2 files changed, 2 insertions, 58 deletions
diff --git a/netbsd/Platform.c b/netbsd/Platform.c
index 354476d3..c4a11e1a 100644
--- a/netbsd/Platform.c
+++ b/netbsd/Platform.c
@@ -1,5 +1,5 @@
/*
-htop - openbsd/Platform.c
+htop - netbsd/Platform.c
(C) 2014 Hisham H. Muhammad
(C) 2021 Santhosh Raju
Released under the GNU GPLv2, see the COPYING file
@@ -16,11 +16,9 @@ in the source distribution for its full text.
#include <string.h>
#include <time.h>
#include <sys/resource.h>
-//#include <sys/sensors.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/types.h>
-//#include <uvm/uvmexp.h>
#include "CPUMeter.h"
#include "ClockMeter.h"
@@ -319,62 +317,8 @@ bool Platform_getNetworkIO(NetworkIOData* data) {
return false;
}
-//static bool findDevice(const char* name, int* mib, struct sensordev* snsrdev, size_t* sdlen) {
-// for (int devn = 0;; devn++) {
-// mib[2] = devn;
-// if (sysctl(mib, 3, snsrdev, sdlen, NULL, 0) == -1) {
-// if (errno == ENXIO)
-// continue;
-// if (errno == ENOENT)
-// return false;
-// }
-// if (String_eq(name, snsrdev->xname)) {
-// return true;
-// }
-// }
-//}
-
void Platform_getBattery(double* percent, ACPresence* isOnAC) {
// TODO
(void)percent;
(void)isOnAC;
-// int mib[] = {CTL_HW, HW_SENSORS, 0, 0, 0};
-// struct sensor s;
-// size_t slen = sizeof(struct sensor);
-// struct sensordev snsrdev;
-// size_t sdlen = sizeof(struct sensordev);
-//
-// bool found = findDevice("acpibat0", mib, &snsrdev, &sdlen);
-//
-// *percent = NAN;
-// if (found) {
-// /* last full capacity */
-// mib[3] = 7;
-// mib[4] = 0;
-// double last_full_capacity = 0;
-// if (sysctl(mib, 5, &s, &slen, NULL, 0) != -1)
-// last_full_capacity = s.value;
-// if (last_full_capacity > 0) {
-// /* remaining capacity */
-// mib[3] = 7;
-// mib[4] = 3;
-// if (sysctl(mib, 5, &s, &slen, NULL, 0) != -1) {
-// double charge = s.value;
-// *percent = 100 * (charge / last_full_capacity);
-// if (charge >= last_full_capacity) {
-// *percent = 100;
-// }
-// }
-// }
-// }
-//
-// found = findDevice("acpiac0", mib, &snsrdev, &sdlen);
-//
-// *isOnAC = AC_ERROR;
-// if (found) {
-// mib[3] = 9;
-// mib[4] = 0;
-// if (sysctl(mib, 5, &s, &slen, NULL, 0) != -1)
-// *isOnAC = s.value;
-// }
}
diff --git a/netbsd/ProcessField.h b/netbsd/ProcessField.h
index 9978ddbc..43fe1694 100644
--- a/netbsd/ProcessField.h
+++ b/netbsd/ProcessField.h
@@ -1,7 +1,7 @@
#ifndef HEADER_NetBSDProcessField
#define HEADER_NetBSDProcessField
/*
-htop - openbsd/ProcessField.h
+htop - netbsd/ProcessField.h
(C) 2020 htop dev team
Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.

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