X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Ffhcount.c;h=97f0438c94f024fb4f526fef7130f38bdf5a1c18;hp=92107839218efc0105b389584a1ca7db29bddc09;hb=a9e50e9e30ecde17e167e271060c8183bfcbf407;hpb=42b8d7550d029ed9aef6f25e3eb2009c1f18b144 diff --git a/src/fhcount.c b/src/fhcount.c index 92107839..97f0438c 100644 --- a/src/fhcount.c +++ b/src/fhcount.c @@ -49,7 +49,7 @@ static int fhcount_config(const char *key, const char *value) { ret = 0; } - return (ret); + return ret; } static void fhcount_submit(const char *type, const char *type_instance, @@ -75,19 +75,18 @@ static int fhcount_read(void) { int prc_used, prc_unused; char *fields[3]; char buffer[buffer_len]; - char errbuf[1024]; FILE *fp; // Open file fp = fopen("/proc/sys/fs/file-nr", "r"); if (fp == NULL) { - ERROR("fhcount: fopen: %s", sstrerror(errno, errbuf, sizeof(errbuf))); - return (EXIT_FAILURE); + ERROR("fhcount: fopen: %s", STRERRNO); + return EXIT_FAILURE; } if (fgets(buffer, buffer_len, fp) == NULL) { - ERROR("fhcount: fgets: %s", sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("fhcount: fgets: %s", STRERRNO); fclose(fp); - return (EXIT_FAILURE); + return EXIT_FAILURE; } fclose(fp); @@ -96,7 +95,7 @@ static int fhcount_read(void) { if (numfields != 3) { ERROR("fhcount: Line doesn't contain 3 fields"); - return (EXIT_FAILURE); + return EXIT_FAILURE; } // Define the values @@ -117,7 +116,7 @@ static int fhcount_read(void) { fhcount_submit("percent", "unused", (gauge_t)prc_unused); } - return (0); + return 0; } void module_register(void) {