X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fswap.c;h=0e317e76cf819bc51201527fcbc34b01d508966b;hp=9e58919e446bf548b6f8ba91e356c001f372425f;hb=f22b9ecc5e5d204e5dcb6861d6fd8039e1fb0181;hpb=ee771cb0c5df11fad393de41571effb9708f0873 diff --git a/src/swap.c b/src/swap.c index 9e58919e..0e317e76 100644 --- a/src/swap.c +++ b/src/swap.c @@ -49,7 +49,9 @@ #if HAVE_SYS_PARAM_H #include #endif -#if HAVE_SYS_SYSCTL_H +#if (defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME)) || \ + defined(__OpenBSD__) +/* implies BSD variant */ #include #endif #if HAVE_SYS_DKSTAT_H @@ -150,12 +152,12 @@ static int swap_init(void) /* {{{ */ { #if KERNEL_LINUX pagesize = (derive_t)sysconf(_SC_PAGESIZE); -/* #endif KERNEL_LINUX */ + /* #endif KERNEL_LINUX */ #elif HAVE_SWAPCTL && HAVE_SWAPCTL_TWO_ARGS /* getpagesize(3C) tells me this does not fail.. */ pagesize = (derive_t)getpagesize(); -/* #endif HAVE_SWAPCTL */ + /* #endif HAVE_SWAPCTL */ #elif defined(VM_SWAPUSAGE) /* No init stuff */ @@ -177,7 +179,7 @@ static int swap_init(void) /* {{{ */ ERROR("swap plugin: kvm_openfiles failed, %s", errbuf); return -1; } -/* #endif HAVE_LIBKVM_GETSWAPINFO */ + /* #endif HAVE_LIBKVM_GETSWAPINFO */ #elif HAVE_LIBSTATGRAB /* No init stuff */