aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cputemp2maxfreq.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/cputemp2maxfreq.c b/cputemp2maxfreq.c
index cd2da9f..91f1941 100644
--- a/cputemp2maxfreq.c
+++ b/cputemp2maxfreq.c
@@ -140,17 +140,21 @@ int main(int argc,char **argv)
if (strcmp(config.temp_input,"auto")==0)
{
config.logger("Starting temperature sensor autodetection");
+ sensor.valid=0;
if (config.cpu>=0)
{
sprintf(sensor_string,"Package id %d",config.cpu);
DEBUG1_MAIN("Searching for sensor \"%s\" because of -P option\n",sensor_string);
cputemp_find_sensor(sensor_string,&sensor);
}
- for(count=0;autodetect_sensors[count]!=NULL;count++)
+ if (sensor.valid==0)
{
- DEBUG1_MAIN("Searching for sensor \"%s\"\n",autodetect_sensors[count]);
- cputemp_find_sensor(autodetect_sensors[count],&sensor);
- if (sensor.valid==1) break;
+ for(count=0;autodetect_sensors[count]!=NULL;count++)
+ {
+ DEBUG1_MAIN("Searching for sensor \"%s\"\n",autodetect_sensors[count]);
+ cputemp_find_sensor(autodetect_sensors[count],&sensor);
+ if (sensor.valid==1) break;
+ }
}
} else {
DEBUG1_MAIN("Starting temperature sensor detection with name \"%s\"\n",config.temp_input);