X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fthermal.c;h=9da8fa5fbb1d92c7a9d80b9defbce04b3f10fdf0;hp=fbae6cc1e686ec177e9dbceaa71f9f99754c5ea9;hb=da11ce02eb202b3e01d3e2d1b40f248a84430973;hpb=936c450a86c841eea89888c8550c9118fae90c25 diff --git a/src/thermal.c b/src/thermal.c index fbae6cc1..9da8fa5f 100644 --- a/src/thermal.c +++ b/src/thermal.c @@ -65,20 +65,20 @@ static int thermal_sysfs_device_read(const char __attribute__((unused)) * dir, if (device_list && ignorelist_match(device_list, name)) return -1; - ssnprintf(filename, sizeof(filename), "%s/%s/temp", dirname_sysfs, name); + snprintf(filename, sizeof(filename), "%s/%s/temp", dirname_sysfs, name); if (parse_value_file(filename, &value, DS_TYPE_GAUGE) == 0) { value.gauge /= 1000.0; thermal_submit(name, TEMP, value); success = 1; } - ssnprintf(filename, sizeof(filename), "%s/%s/cur_state", dirname_sysfs, name); + snprintf(filename, sizeof(filename), "%s/%s/cur_state", dirname_sysfs, name); if (parse_value_file(filename, &value, DS_TYPE_GAUGE) == 0) { thermal_submit(name, COOLING_DEV, value); success = 1; } - return (success ? 0 : -1); + return success ? 0 : -1; } static int thermal_procfs_device_read(const char __attribute__((unused)) * dir, @@ -98,8 +98,8 @@ static int thermal_procfs_device_read(const char __attribute__((unused)) * dir, * temperature: 55 C */ - len = ssnprintf(filename, sizeof(filename), "%s/%s/temperature", - dirname_procfs, name); + len = snprintf(filename, sizeof(filename), "%s/%s/temperature", + dirname_procfs, name); if ((len < 0) || ((size_t)len >= sizeof(filename))) return -1; @@ -168,13 +168,11 @@ static int thermal_config(const char *key, const char *value) { } static int thermal_sysfs_read(void) { - return walk_directory(dirname_sysfs, thermal_sysfs_device_read, - /* user_data = */ NULL, /* include hidden */ 0); + return walk_directory(dirname_sysfs, thermal_sysfs_device_read, NULL, 0); } static int thermal_procfs_read(void) { - return walk_directory(dirname_procfs, thermal_procfs_device_read, - /* user_data = */ NULL, /* include hidden */ 0); + return walk_directory(dirname_procfs, thermal_procfs_device_read, NULL, 0); } static int thermal_init(void) {