X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fswap.c;h=1cf707797f1057b4fb6124c763a46e057b2753ee;hb=89783745dc59079eab34e0c52de6e5e972f50eb2;hp=3018cb9e754460fca13aeaa524349d4f9e517e3a;hpb=bd66a09b35da21dcb405650ae4587bf2ca811438;p=collectd.git diff --git a/src/swap.c b/src/swap.c index 3018cb9e..1cf70779 100644 --- a/src/swap.c +++ b/src/swap.c @@ -36,16 +36,9 @@ # include #endif -#if KERNEL_LINUX || HAVE_LIBKSTAT || defined(VM_SWAPUSAGE) || HAVE_LIBKVM || HAVE_LIBSTATGRAB -# define SWAP_HAVE_READ 1 -#else -# define SWAP_HAVE_READ 0 -#endif - #undef MAX #define MAX(x,y) ((x) > (y) ? (x) : (y)) -#if SWAP_HAVE_READ #if KERNEL_LINUX /* No global variables */ /* #endif KERNEL_LINUX */ @@ -66,6 +59,10 @@ int kvm_pagesize; #elif HAVE_LIBSTATGRAB /* No global variables */ +/* #endif HAVE_LIBSTATGRAB */ + +#else +# error "No applicable input method." #endif /* HAVE_LIBSTATGRAB */ static int swap_init (void) @@ -235,7 +232,7 @@ static int swap_read (void) swap_submit ("used", swap_alloc); swap_submit ("free", swap_avail); - swap_submit ("reserved", swap_resv - swap_alloc); + swap_submit ("reserved", swap_resv); /* #endif HAVE_LIBKSTAT */ #elif defined(VM_SWAPUSAGE) @@ -300,12 +297,9 @@ static int swap_read (void) return (0); } /* int swap_read */ -#endif /* SWAP_HAVE_READ */ void module_register (void) { -#if SWAP_HAVE_READ plugin_register_init ("swap", swap_init); plugin_register_read ("swap", swap_read); -#endif /* SWAP_HAVE_READ */ } /* void module_register */