vl.values = &(value_t){.gauge = value};
vl.values_len = 1;
sstrncpy(vl.plugin, "md", sizeof(vl.plugin));
- ssnprintf(vl.plugin_instance, sizeof(vl.plugin_instance), "%i", minor);
+ snprintf(vl.plugin_instance, sizeof(vl.plugin_instance), "%i", minor);
sstrncpy(vl.type, "md_disks", sizeof(vl.type));
sstrncpy(vl.type_instance, type_instance, sizeof(vl.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;
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;
}
* major/minor, but that again can be tricky if the filesystem
* with the device file is mounted using the "nodev" option.
*/
- ssnprintf(path, sizeof(path), "%s/%s", DEV_DIR, name);
+ snprintf(path, sizeof(path), "%s/%s", DEV_DIR, name);
md_process(minor, path);
}