X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fturbostat.c;h=14ce29fdb20c0ef9d40ddda2ea48af88ea6da991;hb=3307054b6ab46b51fdda4f528e72d119e9de3071;hp=42fed52a3e496b8e87036f20150023ce50a56ff2;hpb=21a4ddcc2d66eea59224fd95746c7533b1b1a46d;p=collectd.git diff --git a/src/turbostat.c b/src/turbostat.c index 42fed52a..14ce29fd 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -1037,6 +1037,7 @@ parse_int_file(const char *fmt, ...) } if (fscanf(filep, "%d", &value) != 1) { ERROR("turbostat plugin: Failed to parse number from '%s'", path); + fclose(filep); return -1; } fclose(filep); @@ -1515,7 +1516,7 @@ check_permissions(void) } if (euidaccess("/dev/cpu/0/msr", R_OK)) { - WARNING("turbostat plugin: Collectd cannot open" + WARNING("turbostat plugin: Collectd cannot open " "/dev/cpu/0/msr. If you don't want to run collectd as " "root, you need to change the ownership (chown) and " "permissions on /dev/cpu/*/msr to allow such access"); @@ -1538,8 +1539,8 @@ turbostat_init(void) int ret; if (stat("/dev/cpu/0/msr", &sb)) { - ERROR("turbostat plugin: Initialization failed: /dev/cpu/0/msr" - " does not exist while the CPU supports MSR. You may be " + ERROR("turbostat plugin: Initialization failed: /dev/cpu/0/msr " + "does not exist while the CPU supports MSR. You may be " "missing the corresponding kernel module, please try '# " "modprobe msr'"); return -1;