From a9fba6f528239db087328a34f4a72b6ba8ee0488 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 10 Apr 2014 15:48:08 -0700 Subject: [PATCH] Move some rarely used includes from config.h --- CMakeLists.txt | 1 + config.h.in | 39 ++++----------------------------------- src/aio_event.c | 8 ++++++++ src/buffer.c | 3 +++ src/client/rspamdclient.c | 6 ++++++ src/main.c | 4 ++++ src/util.c | 7 +++++++ 7 files changed, 33 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a5eb0f9a..1cc4b009e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -729,6 +729,7 @@ CHECK_INCLUDE_FILES(linux/falloc.h HAVE_LINUX_FALLOC_H) CHECK_INCLUDE_FILES(sys/eventfd.h HAVE_SYS_EVENTFD_H) CHECK_INCLUDE_FILES(aio.h HAVE_AIO_H) CHECK_INCLUDE_FILES(libaio.h HAVE_LIBAIO_H) +CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) # Some dependencies IF(HAVE_SYS_WAIT_H) diff --git a/config.h.in b/config.h.in index 1598f51e1..654d63476 100644 --- a/config.h.in +++ b/config.h.in @@ -328,6 +328,10 @@ #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif + /* sysexits */ #ifdef HAVE_SYSEXITS_H #include @@ -416,45 +420,10 @@ #include #endif -#ifdef HAVE_LOCALE_H -#include -#define HAVE_SETLOCALE 1 -#endif - -#ifdef HAVE_SYS_EVENTFD_H -#include -#endif - -#ifdef HAVE_AIO_H -#include -#endif - -#ifdef HAVE_SYS_SENDFILE_H -#include -#endif - #ifdef WITH_GPERF_TOOLS #include #endif -#ifdef HAVE_FETCH_H -#include -#elif defined(CURL_FOUND) -#include -#endif - -#ifdef HAVE_READPASSPHRASE_H -#include -#endif - -#ifdef HAVE_TERMIOS_H -#include -#endif - -#ifdef HAVE_PATHS_H -#include -#endif - #include #include #ifdef HAVE_SIGINFO_H diff --git a/src/aio_event.c b/src/aio_event.c index 60cd95295..ccda37083 100644 --- a/src/aio_event.c +++ b/src/aio_event.c @@ -25,6 +25,14 @@ #include "aio_event.h" #include "main.h" +#ifdef HAVE_SYS_EVENTFD_H +#include +#endif + +#ifdef HAVE_AIO_H +#include +#endif + /* Linux syscall numbers */ #if defined(__i386__) # define SYS_io_setup 245 diff --git a/src/buffer.c b/src/buffer.c index 73bb6e654..33efa86ed 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -25,6 +25,9 @@ #include "config.h" #include "buffer.h" #include "main.h" +#ifdef HAVE_SYS_SENDFILE_H +#include +#endif #define G_DISPATCHER_ERROR dispatcher_error_quark() #define debug_ip(...) rspamd_conditional_debug(rspamd_main->logger, d->peer_addr, __FUNCTION__, __VA_ARGS__) diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c index 293c49214..59dc77b76 100644 --- a/src/client/rspamdclient.c +++ b/src/client/rspamdclient.c @@ -25,6 +25,12 @@ #include "util.h" #include "http.h" +#ifdef HAVE_FETCH_H +#include +#elif defined(CURL_FOUND) +#include +#endif + struct rspamd_client_request; /* diff --git a/src/main.c b/src/main.c index 1c5260428..e5c444a5b 100644 --- a/src/main.c +++ b/src/main.c @@ -42,6 +42,10 @@ #include #include #endif +#ifdef HAVE_LOCALE_H +#include +#define HAVE_SETLOCALE 1 +#endif /* 2 seconds to fork new process in place of dead one */ #define SOFT_FORK_TIME 2 diff --git a/src/util.c b/src/util.c index 2acf58845..3db6a3fe1 100644 --- a/src/util.c +++ b/src/util.c @@ -36,6 +36,13 @@ #include #endif +#ifdef HAVE_TERMIOS_H +#include +#endif +#ifdef HAVE_READPASSPHRASE_H +#include +#endif + /* Check log messages intensity once per minute */ #define CHECK_TIME 60 /* More than 2 log messages per second */ -- 2.39.5