use the simplified shit

This commit is contained in:
2026-05-11 12:13:04 +00:00
parent 77f5494dd9
commit ffc1d55fde
2 changed files with 9 additions and 20 deletions

View File

@@ -19,10 +19,7 @@ void cpu_detect(struct cpu_sensors_t *t, const char *pci_dev) {
return;
}
char buf[128];
char *nt = stpncpy(buf, t->hwmon, sizeof(buf)); // nt is a pointer to the null terminator of the copied string
stpcpy(nt, "/in1_input"); // write at the null terminator address
t->module = file_exists(buf) ? zenpower : k10temp; // idk if this is reliable, we're trying to avoid just reading the name
t->module = read_file(t->hwmon, "/in1_input", NULL, 0) ? zenpower : k10temp; // if we can read zenpower file then zenpower. idk if this is reliable, we're trying to avoid just reading the name
applog(LOG_INF, "Detected %d cores, module enum #%d in path %s", t->num_cores, t->module, t->hwmon);
}