diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c index 16f4d2228..9d56fe135 100644 --- a/src/modules/temperature/e_mod_main.c +++ b/src/modules/temperature/e_mod_main.c @@ -326,24 +326,30 @@ temperature_face_update_config(Config_Face *inst) } #endif snprintf(buf, sizeof(buf), - "%s/%s/tempget %i \"%s\" %i", - e_module_dir_get(temperature_config->module), MODULE_ARCH, - inst->sensor_type, - (inst->sensor_name != NULL ? inst->sensor_name : "(null)"), - inst->poll_interval); - inst->tempget_exe = ecore_exe_pipe_run(buf, - ECORE_EXE_PIPE_READ | - ECORE_EXE_PIPE_READ_LINE_BUFFERED | - ECORE_EXE_NOT_LEADER, - inst); + "%s/%s/tempget %i \"%s\" %i", + e_module_dir_get(temperature_config->module), MODULE_ARCH, + inst->sensor_type, + (inst->sensor_name != NULL ? inst->sensor_name : "(null)"), + inst->poll_interval); + inst->tempget_exe = + ecore_exe_pipe_run(buf, + ECORE_EXE_PIPE_READ | + ECORE_EXE_PIPE_READ_LINE_BUFFERED | + ECORE_EXE_NOT_LEADER, inst); #ifdef HAVE_EEZE_UDEV } else - {/*avoid creating a new poller if possible*/ + { + /*avoid creating a new poller if possible*/ if (inst->temp_poller) - ecore_poller_poller_interval_set(inst->temp_poller, inst->poll_interval); - else - inst->temp_poller = ecore_poller_add(ECORE_POLLER_CORE, inst->poll_interval, temperature_udev_update_poll, inst); + ecore_poller_poller_interval_set(inst->temp_poller, + inst->poll_interval); + else + { + inst->temp_poller = + ecore_poller_add(ECORE_POLLER_CORE, inst->poll_interval, + temperature_udev_update_poll, inst); + } } #endif } @@ -369,26 +375,25 @@ temperature_get_bus_files(const char* bus) { Eina_List *files; char *file; - + /* Search each device for temp*_input, these should be * temperature devices. */ snprintf(path, sizeof(path), "%s/%s", busdir, name); files = ecore_file_ls(path); EINA_LIST_FREE(files, file) + { + if ((!strncmp("temp", file, 4)) && + (!strcmp("_input", &file[strlen(file) - 6]))) { - if ((!strncmp("temp", file, 4)) && - (!strcmp("_input", &file[strlen(file) - 6]))) - { - char *f; + char *f; - snprintf(path, sizeof(path), - "%s/%s/%s", busdir, name, file); - f = strdup(path); + snprintf(path, sizeof(path), + "%s/%s/%s", busdir, name, file); + f = strdup(path); if (f) result = eina_list_append(result, f); } free(file); } - free(name); } } diff --git a/src/modules/temperature/e_mod_udev.c b/src/modules/temperature/e_mod_udev.c index aa6fa8754..22bbd6920 100644 --- a/src/modules/temperature/e_mod_udev.c +++ b/src/modules/temperature/e_mod_udev.c @@ -28,7 +28,7 @@ temperature_udev_update(void *data) EINA_LIST_FOREACH_SAFE(inst->tempdevs, l, l2, syspath) { if ((eeze_udev_syspath_get_sysattr(syspath, "fan1_input")) || - (eeze_udev_syspath_get_sysattr(syspath, "pwm1_stop_time"))) + (eeze_udev_syspath_get_sysattr(syspath, "pwm1_stop_time"))) { eina_stringshare_del(syspath); inst->tempdevs = eina_list_remove_list(inst->tempdevs, l); @@ -39,7 +39,8 @@ temperature_udev_update(void *data) { temp = 0; EINA_LIST_FOREACH(inst->tempdevs, l, syspath) - {/*FIXME: probably should make a function to count the cpus and loop this */ + { + /*FIXME: probably should make a function to count the cpus and loop this */ if ((test = eeze_udev_syspath_get_sysattr(syspath, "temp1_input"))) { temp += (strtod(test, NULL) / 1000); /* udev reports temp in (celcius * 1000) for some reason */ @@ -60,8 +61,8 @@ temperature_udev_update(void *data) } if (temp != -999) { - if (inst->units == FAHRENHEIT) - temp = (temp * 9.0 / 5.0) + 32; + if (inst->units == FAHRENHEIT) + temp = (temp * 9.0 / 5.0) + 32; if (!inst->have_temp) { @@ -76,8 +77,8 @@ temperature_udev_update(void *data) snprintf(buf, sizeof(buf), "%3.2f°C", temp); _temperature_face_level_set(inst, - (double)(temp - inst->low) / - (double)(inst->high - inst->low)); + (double)(temp - inst->low) / + (double)(inst->high - inst->low)); edje_object_part_text_set(inst->o_temp, "e.text.reading", buf); } else