mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 20:24:35 +03:00
Dynamically load libsensors at runtime
This commit is contained in:

committed by
BenBE

parent
f7a8952933
commit
b76eaf187a
@ -183,7 +183,7 @@ static bool Settings_read(Settings* this, const char* fileName, int initialCpuCo
|
||||
this->showCPUUsage = atoi(option[1]);
|
||||
} else if (String_eq(option[0], "show_cpu_frequency")) {
|
||||
this->showCPUFrequency = atoi(option[1]);
|
||||
#ifdef HAVE_LIBSENSORS
|
||||
#ifdef HAVE_SENSORS_SENSORS_H
|
||||
} else if (String_eq(option[0], "show_cpu_temperature")) {
|
||||
this->showCPUTemperature = atoi(option[1]);
|
||||
} else if (String_eq(option[0], "degree_fahrenheit")) {
|
||||
@ -292,7 +292,7 @@ bool Settings_write(Settings* this) {
|
||||
fprintf(fd, "cpu_count_from_one=%d\n", (int) this->countCPUsFromOne);
|
||||
fprintf(fd, "show_cpu_usage=%d\n", (int) this->showCPUUsage);
|
||||
fprintf(fd, "show_cpu_frequency=%d\n", (int) this->showCPUFrequency);
|
||||
#ifdef HAVE_LIBSENSORS
|
||||
#ifdef HAVE_SENSORS_SENSORS_H
|
||||
fprintf(fd, "show_cpu_temperature=%d\n", (int) this->showCPUTemperature);
|
||||
fprintf(fd, "degree_fahrenheit=%d\n", (int) this->degreeFahrenheit);
|
||||
#endif
|
||||
@ -328,7 +328,7 @@ Settings* Settings_new(int initialCpuCount) {
|
||||
this->countCPUsFromOne = false;
|
||||
this->showCPUUsage = true;
|
||||
this->showCPUFrequency = false;
|
||||
#ifdef HAVE_LIBSENSORS
|
||||
#ifdef HAVE_SENSORS_SENSORS_H
|
||||
this->showCPUTemperature = false;
|
||||
this->degreeFahrenheit = false;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user