X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fswap.c;h=ee5afa0d7dd7adad99aaec3081eb9212283dcbe8;hp=9e58919e446bf548b6f8ba91e356c001f372425f;hb=270cadc40a1e935c7d126a70ea58f7d1c2144d7d;hpb=d53b2151ae583d6fc38b1a4dd49a3469635a84c8 diff --git a/src/swap.c b/src/swap.c index 9e58919e..ee5afa0d 100644 --- a/src/swap.c +++ b/src/swap.c @@ -49,7 +49,8 @@ #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 +151,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 +178,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 */