Hi Marco,

Marco Hunsicker <i...@hunsicker.de> writes:
> Looking at src/print_cpu_temperature.c, the following code seems to be 
> the culprit:
>
>      if (thermal_zone == NULL) {
>          if (path == NULL)
>              asprintf(&thermal_zone, THERMAL_ZONE, zone);
>          else
>              asprintf(&thermal_zone, path, zone);
>      }
>      path = thermal_zone;
>
>
>
> I've changed my copy to:
>
>      if (path == NULL) {
>          if (thermal_zone == NULL) {
>              if (path == NULL)
>                  asprintf(&thermal_zone, THERMAL_ZONE, zone);
>              else
>                  asprintf(&thermal_zone, path, zone);
>          }
>          path = thermal_zone;
>      }
>
> as I provide the full paths to the sensor outputs in my config file.
>
> But before I submit a patch, I wanted to ask whether this still catches 
> the intention of this method?
I think your code will actually not work properly either, because
thermal_zone is a static variable. I think you’ll need to kill that
variable entirely to make multiple instances of the cpu_temperature
module work.

-- 
Best regards,
Michael

Reply via email to