X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcpufreq.c;h=1e9e857980c68c3ebcb19af9e9b8c15d3f83ddcc;hb=5523a080010dcb7a61dc0dccc3969a2a048e52f9;hp=b92b1d095226c6a9deea13fa6731d5a68b213478;hpb=6e419a825c50f9c97471aba7d50521bfc7e19828;p=collectd.git diff --git a/src/cpufreq.c b/src/cpufreq.c index b92b1d09..1e9e8579 100644 --- a/src/cpufreq.c +++ b/src/cpufreq.c @@ -21,6 +21,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" @@ -80,12 +81,11 @@ static int cpufreq_read (void) { int status; unsigned long long val; - int i = 0; FILE *fp; char filename[256]; char buffer[16]; - for (i = 0; i < num_cpu; i++) + for (int i = 0; i < num_cpu; i++) { status = ssnprintf (filename, sizeof (filename), "/sys/devices/system/cpu/cpu%d/cpufreq/"