#include "collectd.h"
-#include "common.h"
#include "plugin.h"
-#include "utils_ignorelist.h"
+#include "utils/common/common.h"
+#include "utils/ignorelist/ignorelist.h"
#include <sys/ioctl.h>
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)
} /* 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;
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;
}
/* 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;
}
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;
}