cpu: coretemp out by one !
This commit is contained in:
parent
856b3acd13
commit
a3538e9b43
|
@ -293,6 +293,7 @@ _cpu_n_temperature_read(int n)
|
|||
{
|
||||
int temp = -1;
|
||||
#if defined(__linux__)
|
||||
|
||||
char *b = file_contents(_core_temps[n]);
|
||||
if (b)
|
||||
{
|
||||
|
@ -372,8 +373,11 @@ system_cpu_n_temperature_get(int n)
|
|||
if (type == THERMAL_INTEL_CORETEMP)
|
||||
{
|
||||
cpu_count = system_cpu_count_get();
|
||||
i = 1 + ((cpu_count + n) / 2) - (cpu_count / 2);
|
||||
snprintf(_core_temps[n], sizeof(_core_temps[n]), "%s/temp%d_input", _hwmon_path, i);
|
||||
for (int j = 0; j < cpu_count; j++)
|
||||
{
|
||||
i = 2 + ((cpu_count + j) / 2) - (cpu_count / 2);
|
||||
snprintf(_core_temps[j], sizeof(_core_temps[j]), "%s/temp%d_input", _hwmon_path, i);
|
||||
}
|
||||
}
|
||||
return _cpu_n_temperature_read(n);
|
||||
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
|
|
Loading…
Reference in New Issue