X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcpufreq.c;h=f95b2828a5246806476fc3626809b4457692683c;hb=624f8320b6b25ac03886372e9aa2e704da0e2a83;hp=0f6cd32bce1ba28835f126f6d0a99afb9f5b8668;hpb=391112caa51f46df964767ba6dee1315d83bd4a5;p=collectd.git diff --git a/src/cpufreq.c b/src/cpufreq.c index 0f6cd32b..f95b2828 100644 --- a/src/cpufreq.c +++ b/src/cpufreq.c @@ -26,8 +26,8 @@ #include "utils/common/common.h" #if KERNEL_FREEBSD -#include #include +#include #endif #if KERNEL_LINUX @@ -109,8 +109,10 @@ static int cpufreq_init(void) { int cpufreq; size_t cf_len = sizeof(cpufreq); - if(sysctlbyname(mib, &cpufreq, &cf_len, NULL, 0) != 0) + if (sysctlbyname(mib, &cpufreq, &cf_len, NULL, 0) != 0) { + WARNING("cpufreq plugin: sysctl \"%s\" failed.", mib); plugin_unregister_read("cpufreq"); + } #endif return 0; @@ -231,8 +233,8 @@ static int cpufreq_read(void) { int cpufreq; size_t cf_len = sizeof(cpufreq); - if(sysctlbyname(mib, &cpufreq, &cf_len, NULL, 0) != 0) { - WARNING("cpufreq plugin: reading \"%s\" failed.", mib); + if (sysctlbyname(mib, &cpufreq, &cf_len, NULL, 0) != 0) { + WARNING("cpufreq plugin: sysctl \"%s\" failed.", mib); return 0; }