X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fdisk.c;h=45706bc262044855d58cbf49464ded2c1ea10366;hp=51a50fd1e7c782d6d00ab12be68fbcc42bbfbe85;hb=a9e50e9e30ecde17e167e271060c8183bfcbf407;hpb=3d082a905619c19ca5b7183bb95a30d4d9529c4d diff --git a/src/disk.c b/src/disk.c index 51a50fd1..45706bc2 100644 --- a/src/disk.c +++ b/src/disk.c @@ -120,6 +120,9 @@ static struct gmesh geom_tree; /* #endif KERNEL_FREEBSD */ #elif HAVE_LIBKSTAT +#if HAVE_KSTAT_H +#include +#endif #define MAX_NUMDISK 1024 extern kstat_ctl_t *kc; static kstat_t *ksp[MAX_NUMDISK]; @@ -973,9 +976,7 @@ static int disk_read(void) { int rnumdisk; if ((numdisk = perfstat_disk(NULL, NULL, sizeof(perfstat_disk_t), 0)) < 0) { - char errbuf[1024]; - WARNING("disk plugin: perfstat_disk: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + WARNING("disk plugin: perfstat_disk: %s", STRERRNO); return -1; } @@ -989,9 +990,7 @@ static int disk_read(void) { firstpath.name[0] = '\0'; if ((rnumdisk = perfstat_disk(&firstpath, stat_disk, sizeof(perfstat_disk_t), numdisk)) < 0) { - char errbuf[1024]; - WARNING("disk plugin: perfstat_disk : %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + WARNING("disk plugin: perfstat_disk : %s", STRERRNO); return -1; }