From: Doug MacEachern Date: Fri, 22 May 2009 22:03:57 +0000 (-0700) Subject: Disable LFS flags to avoid 32-bit solaris sys/swap.h error X-Git-Tag: collectd-4.6.3~8 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=799daf946e48c5c3b5f6b016bc9290fe562f062d Disable LFS flags to avoid 32-bit solaris sys/swap.h error --- diff --git a/configure.in b/configure.in index 0fd6e78d..062f8aa5 100644 --- a/configure.in +++ b/configure.in @@ -266,6 +266,8 @@ AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [], have_sys_swap_h="yes" AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"], [ +#undef _FILE_OFFSET_BITS +#undef _LARGEFILE64_SOURCE #if HAVE_SYS_TYPES_H # include #endif diff --git a/src/swap.c b/src/swap.c index 1779f861..de9b5f3d 100644 --- a/src/swap.c +++ b/src/swap.c @@ -19,6 +19,16 @@ * Florian octo Forster **/ +#if HAVE_CONFIG_H +# include "config.h" +# undef HAVE_CONFIG_H +#endif +/* avoid swap.h error "Cannot use swapctl in the large files compilation environment" */ +#if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64 +# undef _FILE_OFFSET_BITS +# undef _LARGEFILE64_SOURCE +#endif + #include "collectd.h" #include "common.h" #include "plugin.h"