X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fcpufreq.c;h=0139947e57527d76bba5353fd132c86a6c5d9f65;hp=608e60e3a4c745377ced242c1e3d7a07910a5db6;hb=da11ce02eb202b3e01d3e2d1b40f248a84430973;hpb=47c86ace348a1d7a5352a83d10935209f89aa4f5 diff --git a/src/cpufreq.c b/src/cpufreq.c index 608e60e3..0139947e 100644 --- a/src/cpufreq.c +++ b/src/cpufreq.c @@ -34,10 +34,10 @@ static int cpufreq_init(void) { num_cpu = 0; while (1) { - status = ssnprintf(filename, sizeof(filename), - "/sys/devices/system/cpu/cpu%d/cpufreq/" - "scaling_cur_freq", - num_cpu); + status = snprintf(filename, sizeof(filename), + "/sys/devices/system/cpu/cpu%d/cpufreq/" + "scaling_cur_freq", + num_cpu); if ((status < 1) || ((unsigned int)status >= sizeof(filename))) break; @@ -62,7 +62,7 @@ static void cpufreq_submit(int cpu_num, value_t value) { vl.values_len = 1; sstrncpy(vl.plugin, "cpufreq", sizeof(vl.plugin)); sstrncpy(vl.type, "cpufreq", sizeof(vl.type)); - ssnprintf(vl.type_instance, sizeof(vl.type_instance), "%i", cpu_num); + snprintf(vl.type_instance, sizeof(vl.type_instance), "%i", cpu_num); plugin_dispatch_values(&vl); } @@ -70,8 +70,8 @@ static void cpufreq_submit(int cpu_num, value_t value) { static int cpufreq_read(void) { for (int i = 0; i < num_cpu; i++) { char filename[PATH_MAX]; - ssnprintf(filename, sizeof(filename), - "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq", i); + snprintf(filename, sizeof(filename), + "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq", i); value_t v; if (parse_value_file(filename, &v, DS_TYPE_GAUGE) != 0) {