Fix cpu fallback temp sensor logic
Break the for loop either way so `path` still points to sensor module's hwmon folder.
@@ -291,12 +291,15 @@ bool CPUStats::GetCpuFile() {
#ifndef NDEBUG
std::cerr << "hwmon: sensor name: " << name << std::endl;
#endif
- if (name == "coretemp" && find_temp_input(path, input, "Package id 0")) {
+ if (name == "coretemp") {
+ find_temp_input(path, input, "Package id 0");
break;
}
- else if ((name == "zenpower" || name == "k10temp") && find_temp_input(path, input, "Tdie")) {
+ else if ((name == "zenpower" || name == "k10temp")) {
+ find_temp_input(path, input, "Tdie");
break;
- } else if (name == "atk0110" && find_temp_input(path, input, "CPU Temperature")){
+ } else if (name == "atk0110") {
+ find_temp_input(path, input, "CPU Temperature");
break;
}
}
