X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fmd.c;h=0a015c7b0088f3796ff14a7f2f085cb235407aca;hp=016e6b0cbe5ef5370465f392453413b50f42054a;hb=06a86a60a7dabc685bdbd81ce3d36ea5f7e2c2d4;hpb=65bdbbfb9c6b287de835e5aa81faee8cd864c1e9 diff --git a/src/md.c b/src/md.c index 016e6b0c..0a015c7b 100644 --- a/src/md.c +++ b/src/md.c @@ -40,7 +40,7 @@ static const char *config_keys[] = {"Device", "IgnoreSelected"}; static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); -static ignorelist_t *ignorelist = NULL; +static ignorelist_t *ignorelist; static int md_config(const char *key, const char *value) { if (ignorelist == NULL) @@ -74,7 +74,6 @@ static void md_submit(const int minor, const char *type_instance, } /* void md_submit */ static void md_process(const int minor, const char *path) { - char errbuf[1024]; int fd; struct stat st; mdu_array_info_t array; @@ -82,13 +81,12 @@ static void md_process(const int minor, const char *path) { fd = open(path, O_RDONLY); if (fd < 0) { - WARNING("md: open(%s): %s", path, sstrerror(errno, errbuf, sizeof(errbuf))); + WARNING("md: open(%s): %s", path, STRERRNO); return; } if (fstat(fd, &st) < 0) { - WARNING("md: Unable to fstat file descriptor for %s: %s", path, - sstrerror(errno, errbuf, sizeof(errbuf))); + WARNING("md: Unable to fstat file descriptor for %s: %s", path, STRERRNO); close(fd); return; } @@ -109,8 +107,7 @@ static void md_process(const int minor, const char *path) { /* Retrieve md information */ if (ioctl(fd, GET_ARRAY_INFO, &array) < 0) { - WARNING("md: Unable to retrieve array info from %s: %s", path, - sstrerror(errno, errbuf, sizeof(errbuf))); + WARNING("md: Unable to retrieve array info from %s: %s", path, STRERRNO); close(fd); return; } @@ -146,9 +143,7 @@ static int md_read(void) { fh = fopen(PROC_DISKSTATS, "r"); if (fh == NULL) { - char errbuf[1024]; - WARNING("md: Unable to open %s: %s", PROC_DISKSTATS, - sstrerror(errno, errbuf, sizeof(errbuf))); + WARNING("md: Unable to open %s: %s", PROC_DISKSTATS, STRERRNO); return -1; }