mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Merge branch 'cleanup-init-done' into master
This commit is contained in:
@ -61,11 +61,12 @@ in the source distribution for its full text.
|
||||
#include "zfs/ZfsArcStats.h"
|
||||
#include "zfs/ZfsCompressedArcMeter.h"
|
||||
|
||||
#ifdef HAVE_LIBSENSORS
|
||||
#include <sensors/sensors.h>
|
||||
#endif
|
||||
|
||||
ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_VIRT, M_RESIDENT, (int)M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
|
||||
|
||||
//static ProcessField defaultIoFields[] = { PID, IO_PRIORITY, USER, IO_READ_RATE, IO_WRITE_RATE, IO_RATE, COMM, 0 };
|
||||
|
||||
int Platform_numberOfFields = LAST_PROCESSFIELD;
|
||||
|
||||
const SignalItem Platform_signals[] = {
|
||||
@ -112,6 +113,23 @@ static time_t Platform_Battery_cacheTime;
|
||||
static double Platform_Battery_cacheLevel = NAN;
|
||||
static ACPresence Platform_Battery_cacheIsOnAC;
|
||||
|
||||
void Platform_init(void) {
|
||||
if (access(PROCDIR, R_OK) != 0) {
|
||||
fprintf(stderr, "Error: could not read procfs (compiled to look in %s).\n", PROCDIR);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBSENSORS
|
||||
sensors_init(NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Platform_done(void) {
|
||||
#ifdef HAVE_LIBSENSORS
|
||||
sensors_cleanup();
|
||||
#endif
|
||||
}
|
||||
|
||||
static Htop_Reaction Platform_actionSetIOPriority(State* st) {
|
||||
Panel* panel = st->panel;
|
||||
|
||||
|
Reference in New Issue
Block a user