diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index ff156c9ab53..73c2e65ecdc 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -18,16 +18,27 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "lib/tdb_wrap/tdb_wrap.h"
-#include "tdb.h"
-#include "lib/util/dlinklist.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/locale.h"
-#include
-#include "../include/ctdb_private.h"
+
+#include
+/* Allow use of deprecated function tevent_loop_allow_nesting() */
+#define TEVENT_DEPRECATED
+#include
+#include
+
+#include "lib/tdb_wrap/tdb_wrap.h"
#include "lib/util/dlinklist.h"
+#include "lib/util/time.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+
#include "common/reqid.h"
#include "common/system.h"
diff --git a/ctdb/common/cmdline.c b/ctdb/common/cmdline.c
index e6910116fef..fa7221d571e 100644
--- a/ctdb/common/cmdline.c
+++ b/ctdb/common/cmdline.c
@@ -17,16 +17,25 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "../include/ctdb_client.h"
-#include "../include/ctdb_private.h"
-#include "../common/rb_tree.h"
+#include "system/network.h"
+
+#include
+#include
+#include
#include
+#include "lib/util/debug.h"
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+
+#include "common/rb_tree.h"
#include "common/cmdline.h"
+
+
/* Handle common command line options for ctdb test progs
*/
diff --git a/ctdb/common/ctdb_fork.c b/ctdb/common/ctdb_fork.c
index 336bc8ee134..c6673eb8661 100644
--- a/ctdb/common/ctdb_fork.c
+++ b/ctdb/common/ctdb_fork.c
@@ -17,11 +17,20 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/wait.h"
-#include "../include/ctdb_client.h"
-#include "../include/ctdb_private.h"
-#include "../common/rb_tree.h"
+#include "system/network.h"
+
+#include
+#include
+
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+
+#include "common/rb_tree.h"
#include "common/system.h"
void ctdb_set_child_info(TALLOC_CTX *mem_ctx, const char *child_name_fmt, ...)
diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c
index a99c56e9079..46199b8c015 100644
--- a/ctdb/common/ctdb_io.c
+++ b/ctdb/common/ctdb_io.c
@@ -20,14 +20,20 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
-#include "lib/util/dlinklist.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
-#include "../include/ctdb_private.h"
-#include "../include/ctdb_client.h"
-#include
+
+#include
+#include
+#include
+
+#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+#include "ctdb_client.h"
#include "common/system.h"
diff --git a/ctdb/common/ctdb_ltdb.c b/ctdb/common/ctdb_ltdb.c
index f4d571ec966..4e7fcafb54f 100644
--- a/ctdb/common/ctdb_ltdb.c
+++ b/ctdb/common/ctdb_ltdb.c
@@ -18,13 +18,18 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
-#include "../include/ctdb_private.h"
+
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
/*
find an attached ctdb_db handle given a name
diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c
index 474ebfa9faf..d158143f920 100644
--- a/ctdb/common/ctdb_util.c
+++ b/ctdb/common/ctdb_util.c
@@ -17,12 +17,19 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
+
+#include
+
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+
#include "common/reqid.h"
#include "common/system.h"
diff --git a/ctdb/common/rb_tree.c b/ctdb/common/rb_tree.c
index 6b131bc0932..4b1ff97199e 100644
--- a/ctdb/common/rb_tree.c
+++ b/ctdb/common/rb_tree.c
@@ -17,7 +17,13 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
+
+#include
+
+#include "lib/util/debug.h"
+#include "ctdb_logging.h"
+
#include "rb_tree.h"
#define NO_MEMORY_FATAL(p) do { if (!(p)) { \
diff --git a/ctdb/common/system_aix.c b/ctdb/common/system_aix.c
index 59ee87185f6..e2b6536962d 100644
--- a/ctdb/common/system_aix.c
+++ b/ctdb/common/system_aix.c
@@ -19,11 +19,16 @@
*/
-#include "includes.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
+
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+
#include
#include
#include
diff --git a/ctdb/common/system_common.c b/ctdb/common/system_common.c
index 1e0a095ec8c..9b12236be08 100644
--- a/ctdb/common/system_common.c
+++ b/ctdb/common/system_common.c
@@ -18,9 +18,12 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/network.h"
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
#include "ctdb_private.h"
#include "common/system.h"
diff --git a/ctdb/common/system_freebsd.c b/ctdb/common/system_freebsd.c
index e132e5ce493..320941f7ee2 100644
--- a/ctdb/common/system_freebsd.c
+++ b/ctdb/common/system_freebsd.c
@@ -24,11 +24,16 @@
needs, and inspired by 'common/system_aix.c' for the pcap usage.
*/
-#include "includes.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
+
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+
#include
#include
#include
diff --git a/ctdb/common/system_gnu.c b/ctdb/common/system_gnu.c
index 7921655b5c7..f38e622b3c8 100644
--- a/ctdb/common/system_gnu.c
+++ b/ctdb/common/system_gnu.c
@@ -23,11 +23,16 @@
and inspired by 'common/system_aix.c' for the pcap usage.
*/
-#include "includes.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
+
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+
#include
#include
#include
diff --git a/ctdb/common/system_kfreebsd.c b/ctdb/common/system_kfreebsd.c
index dd7f71a6af2..f4ecc289b22 100644
--- a/ctdb/common/system_kfreebsd.c
+++ b/ctdb/common/system_kfreebsd.c
@@ -23,11 +23,16 @@
needs, and inspired by 'common/system_aix.c' for the pcap usage.
*/
-#include "includes.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
+
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+
#include
#include
#include
diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c
index bca928dc2f2..d8a6e68462c 100644
--- a/ctdb/common/system_linux.c
+++ b/ctdb/common/system_linux.c
@@ -18,11 +18,16 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
+
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+
#include
#include
#include
diff --git a/ctdb/common/system_util.c b/ctdb/common/system_util.c
index 088d86b449c..91e2621e39c 100644
--- a/ctdb/common/system_util.c
+++ b/ctdb/common/system_util.c
@@ -18,12 +18,16 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
#include "system/shmem.h"
+#include "system/network.h"
#include
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
#include "ctdb_private.h"
#include "common/system.h"
diff --git a/ctdb/ib/ibw_ctdb.c b/ctdb/ib/ibw_ctdb.c
index 96b126c4eaa..35d0514b682 100644
--- a/ctdb/ib/ibw_ctdb.c
+++ b/ctdb/ib/ibw_ctdb.c
@@ -20,10 +20,19 @@
* along with this program; if not, see .
*/
-#include "includes.h"
-#include
+#include "replace.h"
+#include "system/network.h"
+
#include
+#include
+#include
+
+#include "lib/util/time.h"
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
#include "ctdb_private.h"
+
#include "ibwrapper.h"
#include "ibw_ctdb.h"
diff --git a/ctdb/ib/ibw_ctdb_init.c b/ctdb/ib/ibw_ctdb_init.c
index b71909ad0f8..ec4d933b3da 100644
--- a/ctdb/ib/ibw_ctdb_init.c
+++ b/ctdb/ib/ibw_ctdb_init.c
@@ -20,13 +20,21 @@
* along with this program; if not, see .
*/
-#include "includes.h"
-#include
+#include "replace.h"
+#include "system/network.h"
+
#include
+#include
+#include
+
+#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
#include "ctdb_private.h"
+
#include "ibwrapper.h"
#include "ibw_ctdb.h"
-#include "lib/util/dlinklist.h"
static int ctdb_ibw_listen(struct ctdb_context *ctdb, int backlog)
{
diff --git a/ctdb/ib/ibwrapper.c b/ctdb/ib/ibwrapper.c
index 523cfacf401..ad97fda4aa8 100644
--- a/ctdb/ib/ibwrapper.c
+++ b/ctdb/ib/ibwrapper.c
@@ -20,28 +20,24 @@
* along with this program; if not, see .
*/
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include "replace.h"
+#include "system/network.h"
-#include "includes.h"
-#include "ibwrapper.h"
+#include
+#include
+#include
+
+#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
#include
#include
#include
+#include "ibwrapper.h"
#include "ibwrapper_internal.h"
-#include "lib/util/dlinklist.h"
#define IBW_LASTERR_BUFSIZE 512
static char ibw_lasterr[IBW_LASTERR_BUFSIZE];
diff --git a/ctdb/ib/ibwrapper_test.c b/ctdb/ib/ibwrapper_test.c
index f8cf99604a7..537df915eaa 100644
--- a/ctdb/ib/ibwrapper_test.c
+++ b/ctdb/ib/ibwrapper_test.c
@@ -20,23 +20,19 @@
* along with this program; if not, see .
*/
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include "replace.h"
+#include "system/network.h"
+#include "system/time.h"
+
+#include
+#include
+#include
+
+#include "lib/util/time.h"
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
-#include "includes.h"
#include "ib/ibwrapper.h"
struct ibwtest_ctx {
diff --git a/ctdb/server/ctdb_banning.c b/ctdb/server/ctdb_banning.c
index 0623ec4636d..8bc87257d47 100644
--- a/ctdb/server/ctdb_banning.c
+++ b/ctdb/server/ctdb_banning.c
@@ -16,14 +16,21 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/time.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
-#include "../include/ctdb_client.h"
-#include "../include/ctdb_private.h"
+
+#include
+#include
+
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
static void ctdb_ban_node_event(struct tevent_context *ev,
diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c
index a919e18948e..80716cdae05 100644
--- a/ctdb/server/ctdb_call.c
+++ b/ctdb/server/ctdb_call.c
@@ -20,13 +20,22 @@
see http://wiki.samba.org/index.php/Samba_%26_Clustering for
protocol design and packet details
*/
-#include "includes.h"
-#include "tdb.h"
-#include "lib/util/dlinklist.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
-#include "../include/ctdb_private.h"
-#include "../common/rb_tree.h"
+
+#include
+#include
+
+#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
+#include "common/rb_tree.h"
#include "common/reqid.h"
#include "common/system.h"
diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c
index eeb810f96ec..5e4516cbb37 100644
--- a/ctdb/server/ctdb_control.c
+++ b/ctdb/server/ctdb_control.c
@@ -16,15 +16,24 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
-#include "lib/util/dlinklist.h"
+
+#include
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
+#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
#include "lib/util/talloc_report.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
#include "common/reqid.h"
diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c
index d8c2280a426..3598c580ac4 100644
--- a/ctdb/server/ctdb_daemon.c
+++ b/ctdb/server/ctdb_daemon.c
@@ -17,18 +17,29 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "lib/tdb_wrap/tdb_wrap.h"
-#include "tdb.h"
-#include "lib/util/dlinklist.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
+#include "system/time.h"
+
+#include
+/* Allow use of deprecated function tevent_loop_allow_nesting() */
+#define TEVENT_DEPRECATED
+#include
+#include
+
+#include "lib/tdb_wrap/tdb_wrap.h"
+#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
#include "../include/ctdb_version.h"
-#include "../include/ctdb_client.h"
-#include "../include/ctdb_private.h"
-#include "../common/rb_tree.h"
-#include
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
+#include "common/rb_tree.h"
#include "common/reqid.h"
#include "common/system.h"
diff --git a/ctdb/server/ctdb_event_helper.c b/ctdb/server/ctdb_event_helper.c
index 7d24820d6df..8db02b91009 100644
--- a/ctdb/server/ctdb_event_helper.c
+++ b/ctdb/server/ctdb_event_helper.c
@@ -17,9 +17,15 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
+#include "system/network.h"
+#include "system/wait.h"
+
+#include
+
#include "ctdb_private.h"
+
#include "common/system.h"
static char *progname = NULL;
diff --git a/ctdb/server/ctdb_freeze.c b/ctdb/server/ctdb_freeze.c
index 5a688d3d7a3..9d370648a00 100644
--- a/ctdb/server/ctdb_freeze.c
+++ b/ctdb/server/ctdb_freeze.c
@@ -16,15 +16,22 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
-#include "lib/util/dlinklist.h"
+
+#include
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
-#include "../common/rb_tree.h"
+#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+
+#include "ctdb_private.h"
+#include "ctdb_logging.h"
+
+#include "common/rb_tree.h"
/**
diff --git a/ctdb/server/ctdb_keepalive.c b/ctdb/server/ctdb_keepalive.c
index c286618c0a3..6873d75f50a 100644
--- a/ctdb/server/ctdb_keepalive.c
+++ b/ctdb/server/ctdb_keepalive.c
@@ -18,10 +18,20 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
+#include "system/network.h"
+#include "system/time.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
+
+#include
+#include
+
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_logging.h"
/*
diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c
index 734327e9cce..cdda7ea85d0 100644
--- a/ctdb/server/ctdb_lock.c
+++ b/ctdb/server/ctdb_lock.c
@@ -17,14 +17,22 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see .
*/
-#include "includes.h"
-#include "include/ctdb_private.h"
-#include "include/ctdb_protocol.h"
-#include "tevent.h"
-#include "tdb.h"
-#include "lib/tdb_wrap/tdb_wrap.h"
+#include "replace.h"
#include "system/filesys.h"
+#include "system/network.h"
+
+#include
+#include
+
+#include "lib/tdb_wrap/tdb_wrap.h"
#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_protocol.h"
+#include "ctdb_logging.h"
+
#include "common/system.h"
/*
diff --git a/ctdb/server/ctdb_lock_helper.c b/ctdb/server/ctdb_lock_helper.c
index c48a925bd95..543c5d0eb7d 100644
--- a/ctdb/server/ctdb_lock_helper.c
+++ b/ctdb/server/ctdb_lock_helper.c
@@ -17,10 +17,14 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/filesys.h"
+#include "system/network.h"
+
+#include
+
#include "ctdb_private.h"
+
#include "common/system.h"
static char *progname = NULL;
diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c
index 7eefe232599..d4545a9d4c6 100644
--- a/ctdb/server/ctdb_logging.c
+++ b/ctdb/server/ctdb_logging.c
@@ -17,14 +17,22 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "../include/ctdb_client.h"
-#include "../include/ctdb_private.h"
+#include "replace.h"
+#include "system/filesys.h"
+#include "system/network.h"
#include "system/syslog.h"
#include "system/time.h"
-#include "system/filesys.h"
-#include "lib/util/debug.h"
+
+#include
+#include
+
#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
#include "common/system.h"
struct ctdb_log_backend {
diff --git a/ctdb/server/ctdb_logging_file.c b/ctdb/server/ctdb_logging_file.c
index 24a4167f6ea..e1586e1e242 100644
--- a/ctdb/server/ctdb_logging_file.c
+++ b/ctdb/server/ctdb_logging_file.c
@@ -17,12 +17,20 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "../include/ctdb_client.h"
-#include "../include/ctdb_private.h"
+#include "replace.h"
#include "system/time.h"
#include "system/filesys.h"
+#include "system/network.h"
+
+#include
+
+#include "lib/util/debug.h"
#include "lib/util/time_basic.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
#include "common/system.h"
#define CTDB_LOG_FILE_PREFIX "file"
diff --git a/ctdb/server/ctdb_logging_syslog.c b/ctdb/server/ctdb_logging_syslog.c
index f651207bb4c..c1ba1f4f096 100644
--- a/ctdb/server/ctdb_logging_syslog.c
+++ b/ctdb/server/ctdb_logging_syslog.c
@@ -21,10 +21,13 @@
#include "replace.h"
#include "system/network.h"
#include "system/syslog.h"
+
#include "lib/util/debug.h"
#include "lib/util/blocking.h"
#include "lib/util/time_basic.h"
#include "lib/util/samba_util.h" /* get_myname */
+
+#include "ctdb_private.h"
#include "ctdb_logging.h"
/* Linux and FreeBSD define this appropriately - try good old /dev/log
diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c
index becf80f8b1b..1affada5f0f 100644
--- a/ctdb/server/ctdb_ltdb_server.c
+++ b/ctdb/server/ctdb_ltdb_server.c
@@ -17,17 +17,26 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/dir.h"
#include "system/time.h"
-#include "../include/ctdb_private.h"
-#include "../common/rb_tree.h"
+#include "system/locale.h"
+
+#include
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
#include "lib/util/dlinklist.h"
-#include
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
+#include "common/rb_tree.h"
#include "common/reqid.h"
#include "common/system.h"
diff --git a/ctdb/server/ctdb_monitor.c b/ctdb/server/ctdb_monitor.c
index 44c3a7db89e..4f861e82e2c 100644
--- a/ctdb/server/ctdb_monitor.c
+++ b/ctdb/server/ctdb_monitor.c
@@ -18,10 +18,20 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
+#include "system/network.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
+
+#include
+#include
+
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_logging.h"
+
#include "common/system.h"
struct ctdb_monitor_state {
diff --git a/ctdb/server/ctdb_persistent.c b/ctdb/server/ctdb_persistent.c
index 20397452ef7..aa878044d33 100644
--- a/ctdb/server/ctdb_persistent.c
+++ b/ctdb/server/ctdb_persistent.c
@@ -18,12 +18,22 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
+#include "system/network.h"
+#include "system/time.h"
#include "system/wait.h"
+
+#include
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
-#include "tdb.h"
-#include "../include/ctdb_private.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_logging.h"
+
#include "common/reqid.h"
struct ctdb_persistent_state {
diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c
index 9738fa88192..23226d3bf08 100644
--- a/ctdb/server/ctdb_recover.c
+++ b/ctdb/server/ctdb_recover.c
@@ -17,15 +17,25 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/time.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
-#include "lib/util/dlinklist.h"
+
+#include
+#include
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
+#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
#include "common/system.h"
int
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 5532db67216..8eaed2b7bed 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -17,18 +17,28 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
#include "system/time.h"
#include "system/network.h"
#include "system/wait.h"
-#include "popt.h"
-#include "common/cmdline.h"
-#include "../include/ctdb_client.h"
-#include "../include/ctdb_private.h"
+
+#include
+#include
+#include
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
#include "common/system.h"
+#include "common/cmdline.h"
/* List of SRVID requests that need to be processed */
diff --git a/ctdb/server/ctdb_server.c b/ctdb/server/ctdb_server.c
index 2f4a1d3e0ca..95ded142671 100644
--- a/ctdb/server/ctdb_server.c
+++ b/ctdb/server/ctdb_server.c
@@ -17,12 +17,20 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
-#include "lib/util/dlinklist.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
-#include "../include/ctdb_private.h"
+
+#include
+#include
+
+#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
/*
choose the transport we will use
diff --git a/ctdb/server/ctdb_serverids.c b/ctdb/server/ctdb_serverids.c
index d264a1f9a35..9186cc5beee 100644
--- a/ctdb/server/ctdb_serverids.c
+++ b/ctdb/server/ctdb_serverids.c
@@ -16,9 +16,17 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see .
*/
-#include "includes.h"
-#include "../include/ctdb_private.h"
-#include "../common/rb_tree.h"
+#include "replace.h"
+#include "system/network.h"
+
+#include
+
+#include "lib/util/debug.h"
+
+#include "ctdb_private.h"
+#include "ctdb_logging.h"
+
+#include "common/rb_tree.h"
#include "common/reqid.h"
diff --git a/ctdb/server/ctdb_statistics.c b/ctdb/server/ctdb_statistics.c
index cb245d60806..c96858631b0 100644
--- a/ctdb/server/ctdb_statistics.c
+++ b/ctdb/server/ctdb_statistics.c
@@ -17,9 +17,18 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include
-#include "../include/ctdb_private.h"
+#include "replace.h"
+#include "system/network.h"
+#include "system/time.h"
+
+#include
+#include
+
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_logging.h"
static void ctdb_statistics_update(struct tevent_context *ev,
struct tevent_timer *te,
diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index 4535ee2b073..c806178b50a 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -18,14 +18,24 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
-#include "lib/util/dlinklist.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
+#include "system/time.h"
#include "system/wait.h"
-#include "../include/ctdb_private.h"
-#include "../common/rb_tree.h"
+
+#include
+#include
+
+#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
+#include "common/rb_tree.h"
#include "common/reqid.h"
#include "common/system.h"
diff --git a/ctdb/server/ctdb_traverse.c b/ctdb/server/ctdb_traverse.c
index 1f1562b2e35..4cdb3d02dfd 100644
--- a/ctdb/server/ctdb_traverse.c
+++ b/ctdb/server/ctdb_traverse.c
@@ -17,13 +17,24 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
+#include "system/network.h"
#include "system/wait.h"
+#include "system/time.h"
+
+#include
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
-#include "tdb.h"
-#include "../include/ctdb_private.h"
#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
#include "common/reqid.h"
#include "common/system.h"
diff --git a/ctdb/server/ctdb_tunables.c b/ctdb/server/ctdb_tunables.c
index 031e60f4968..230a315b73a 100644
--- a/ctdb/server/ctdb_tunables.c
+++ b/ctdb/server/ctdb_tunables.c
@@ -16,8 +16,16 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see .
*/
-#include "includes.h"
-#include "../include/ctdb_private.h"
+#include "replace.h"
+#include "system/network.h"
+
+#include
+#include
+
+#include "lib/util/debug.h"
+
+#include "ctdb_private.h"
+#include "ctdb_logging.h"
static const struct {
const char *name;
diff --git a/ctdb/server/ctdb_update_record.c b/ctdb/server/ctdb_update_record.c
index 398cdbaa350..1c3fef2a071 100644
--- a/ctdb/server/ctdb_update_record.c
+++ b/ctdb/server/ctdb_update_record.c
@@ -18,10 +18,21 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
+#include "system/network.h"
+#include "system/time.h"
+
+#include
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
-#include "tdb.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
#include "common/system.h"
struct ctdb_persistent_write_state {
diff --git a/ctdb/server/ctdb_uptime.c b/ctdb/server/ctdb_uptime.c
index b45ea80dd19..7968cdc37d6 100644
--- a/ctdb/server/ctdb_uptime.c
+++ b/ctdb/server/ctdb_uptime.c
@@ -17,11 +17,19 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "../include/ctdb_private.h"
+#include "replace.h"
#include "system/syslog.h"
#include "system/time.h"
#include "system/filesys.h"
+#include "system/network.h"
+
+#include
+
+#include "lib/util/debug.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
/*
returns the ctdb uptime
diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c
index 49bc7ff7159..3d61befd620 100644
--- a/ctdb/server/ctdb_vacuum.c
+++ b/ctdb/server/ctdb_vacuum.c
@@ -19,16 +19,24 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
-#include "system/dir.h"
-#include "../include/ctdb_private.h"
+#include "system/time.h"
+
+#include
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
#include "lib/util/dlinklist.h"
-#include "../include/ctdb_private.h"
-#include "../common/rb_tree.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_logging.h"
+
+#include "common/rb_tree.h"
#include "common/system.h"
#define TIMELIMIT() timeval_current_ofs(10, 0)
diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c
index ff6d181f095..58313844174 100644
--- a/ctdb/server/ctdbd.c
+++ b/ctdb/server/ctdbd.c
@@ -17,16 +17,27 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
#include "system/time.h"
#include "system/wait.h"
#include "system/network.h"
-#include "common/cmdline.h"
-#include "../include/ctdb_private.h"
+
+#include
+#include
+/* Allow use of deprecated function tevent_loop_allow_nesting() */
+#define TEVENT_DEPRECATED
+#include
+
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_logging.h"
+
#include "common/reqid.h"
#include "common/system.h"
+#include "common/cmdline.h"
static struct {
const char *nlist;
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index 27ec91f7bb8..2fac047626a 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/server/eventscript.c
@@ -17,17 +17,28 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include
+#include "replace.h"
#include "system/filesys.h"
+#include "system/network.h"
#include "system/wait.h"
#include "system/dir.h"
#include "system/locale.h"
-#include "../include/ctdb_private.h"
-#include "../common/rb_tree.h"
+#include "system/time.h"
+
+#include
+#include
+
#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+#include "lib/util/samba_util.h"
+
+#include "ctdb_private.h"
+#include "ctdb_logging.h"
+
+#include "common/rb_tree.h"
#include "common/system.h"
+
static void ctdb_event_script_timeout(struct tevent_context *ev,
struct tevent_timer *te,
struct timeval t, void *p);
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c
index d79b581ec93..0b18c968e1e 100644
--- a/ctdb/tcp/tcp_connect.c
+++ b/ctdb/tcp/tcp_connect.c
@@ -18,12 +18,21 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
-#include "../include/ctdb_private.h"
+
+#include
+#include
+
+#include "lib/util/debug.h"
+#include "lib/util/time.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+
#include "common/system.h"
+
#include "ctdb_tcp.h"
/*
diff --git a/ctdb/tcp/tcp_init.c b/ctdb/tcp/tcp_init.c
index 9619975887b..02f580277ef 100644
--- a/ctdb/tcp/tcp_init.c
+++ b/ctdb/tcp/tcp_init.c
@@ -17,11 +17,19 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
-#include "../include/ctdb_private.h"
+
+#include
+#include
+
+#include "lib/util/time.h"
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+
#include "ctdb_tcp.h"
static int tnode_destructor(struct ctdb_tcp_node *tnode)
diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c
index a951320a07d..5be8d85e533 100644
--- a/ctdb/tcp/tcp_io.c
+++ b/ctdb/tcp/tcp_io.c
@@ -17,12 +17,16 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "lib/util/dlinklist.h"
-#include "tdb.h"
+#include "replace.h"
#include "system/network.h"
#include "system/filesys.h"
-#include "../include/ctdb_private.h"
+
+#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+
#include "ctdb_tcp.h"
diff --git a/ctdb/tests/src/ctdb_bench.c b/ctdb/tests/src/ctdb_bench.c
index bc0a7cc2880..1b0c30bc6ab 100644
--- a/ctdb/tests/src/ctdb_bench.c
+++ b/ctdb/tests/src/ctdb_bench.c
@@ -17,15 +17,22 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
-#include "ctdb_client.h"
-#include "ctdb_private.h"
+#include "system/network.h"
-#include
-#include
+#include
+#include
+#include
+
+#include "lib/util/time.h"
+#include "lib/util/debug.h"
+
+#include "common/cmdline.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+#include "ctdb_client.h"
static struct timeval tp1,tp2;
diff --git a/ctdb/tests/src/ctdb_fetch.c b/ctdb/tests/src/ctdb_fetch.c
index 5567af3e764..592332b14c0 100644
--- a/ctdb/tests/src/ctdb_fetch.c
+++ b/ctdb/tests/src/ctdb_fetch.c
@@ -17,13 +17,23 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
+#include "system/network.h"
+
+#include
+#include
+/* Allow use of deprecated function tevent_loop_allow_nesting() */
+#define TEVENT_DEPRECATED
+#include
+#include
+
+#include "lib/util/time.h"
+
+#include "ctdb_client.h"
+
+#include "common/cmdline.h"
-#include
-#include
static struct timeval tp1,tp2;
diff --git a/ctdb/tests/src/ctdb_fetch_one.c b/ctdb/tests/src/ctdb_fetch_one.c
index b704a6bc27c..b92014a383f 100644
--- a/ctdb/tests/src/ctdb_fetch_one.c
+++ b/ctdb/tests/src/ctdb_fetch_one.c
@@ -18,13 +18,20 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
+#include "system/network.h"
-#include
-#include
+#include
+#include
+#include
+#include
+
+#include "lib/util/time.h"
+
+#include "ctdb_client.h"
+
+#include "common/cmdline.h"
static int timelimit = 10;
static int lock_count = 0;
diff --git a/ctdb/tests/src/ctdb_fetch_readonly_loop.c b/ctdb/tests/src/ctdb_fetch_readonly_loop.c
index fdd5007fd86..29d7c2dcee6 100644
--- a/ctdb/tests/src/ctdb_fetch_readonly_loop.c
+++ b/ctdb/tests/src/ctdb_fetch_readonly_loop.c
@@ -18,12 +18,22 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
+#include "system/network.h"
#include "system/time.h"
-#include "popt.h"
-#include "cmdline.h"
+
+#include
+#include
+#include
+#include
+
+#include "lib/util/time.h"
+
#include "ctdb_private.h"
+#include "ctdb_client.h"
+
+#include "common/cmdline.h"
static struct ctdb_db_context *ctdb_db;
diff --git a/ctdb/tests/src/ctdb_fetch_readonly_once.c b/ctdb/tests/src/ctdb_fetch_readonly_once.c
index 3b364f34096..206f52da7a0 100644
--- a/ctdb/tests/src/ctdb_fetch_readonly_once.c
+++ b/ctdb/tests/src/ctdb_fetch_readonly_once.c
@@ -18,10 +18,18 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include
+#include "system/network.h"
+
+#include
+#include
+#include
+#include
+
+#include "lib/util/time.h"
+
+#include "ctdb_client.h"
const char *TESTKEY = "testkey";
diff --git a/ctdb/tests/src/ctdb_lock_tdb.c b/ctdb/tests/src/ctdb_lock_tdb.c
index a53ffa13f95..df313c64abb 100644
--- a/ctdb/tests/src/ctdb_lock_tdb.c
+++ b/ctdb/tests/src/ctdb_lock_tdb.c
@@ -1,7 +1,7 @@
-#include
-#include
+#include "replace.h"
+#include "system/filesys.h"
-#include "includes.h"
+#include
const char *tdb_file;
TDB_CONTEXT *tdb;
diff --git a/ctdb/tests/src/ctdb_persistent.c b/ctdb/tests/src/ctdb_persistent.c
index 99bd54c1a52..ac3e15d457e 100644
--- a/ctdb/tests/src/ctdb_persistent.c
+++ b/ctdb/tests/src/ctdb_persistent.c
@@ -18,13 +18,22 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
+#include "system/network.h"
-#include
-#include
+#include
+#include
+#include
+#include
+
+#include "lib/util/debug.h"
+#include "lib/util/time.h"
+
+#include "common/cmdline.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_client.h"
static struct timeval tp1,tp2;
diff --git a/ctdb/tests/src/ctdb_porting_tests.c b/ctdb/tests/src/ctdb_porting_tests.c
index c8e268f58a1..8718faaa7df 100644
--- a/ctdb/tests/src/ctdb_porting_tests.c
+++ b/ctdb/tests/src/ctdb_porting_tests.c
@@ -17,13 +17,24 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "include/ctdb_private.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
+#include "system/network.h"
+
+#include
+#include
+#include
+#include
+
+#include "lib/util/debug.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_client.h"
+
+#include "common/cmdline.h"
#include "common/system.h"
+
static struct {
const char *socketname;
const char *debuglevel;
diff --git a/ctdb/tests/src/ctdb_randrec.c b/ctdb/tests/src/ctdb_randrec.c
index 0813295e084..c861d318d31 100644
--- a/ctdb/tests/src/ctdb_randrec.c
+++ b/ctdb/tests/src/ctdb_randrec.c
@@ -18,14 +18,23 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
-#include "ctdb_private.h"
+#include "system/network.h"
+#include "system/time.h"
-#include
-#include
+#include
+#include
+#include
+
+#include "lib/util/debug.h"
+#include "lib/util/time.h"
+
+#include "common/cmdline.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_private.h"
+#include "ctdb_client.h"
static struct timeval tp1,tp2;
diff --git a/ctdb/tests/src/ctdb_store.c b/ctdb/tests/src/ctdb_store.c
index b0a7abb75e6..756c98db3ec 100644
--- a/ctdb/tests/src/ctdb_store.c
+++ b/ctdb/tests/src/ctdb_store.c
@@ -18,13 +18,20 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
+#include "system/network.h"
-#include
-#include
+#include
+#include
+#include
+#include
+
+#include "lib/util/time.h"
+
+#include "common/cmdline.h"
+
+#include "ctdb_client.h"
static int num_records = 10;
static int base_rec;
diff --git a/ctdb/tests/src/ctdb_trackingdb_test.c b/ctdb/tests/src/ctdb_trackingdb_test.c
index 1d0cf8b5ca4..a3764e35ab1 100644
--- a/ctdb/tests/src/ctdb_trackingdb_test.c
+++ b/ctdb/tests/src/ctdb_trackingdb_test.c
@@ -22,13 +22,21 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
+#include "system/network.h"
#include "system/time.h"
-#include "popt.h"
-#include "cmdline.h"
-#include "ctdb_private.h"
+
+#include
+#include
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
+#include "lib/util/time.h"
+
+#include "common/cmdline.h"
+
+#include "ctdb_private.h"
#define MAXINDEX 64
char indices[MAXINDEX];
diff --git a/ctdb/tests/src/ctdb_transaction.c b/ctdb/tests/src/ctdb_transaction.c
index 53d0e3d812e..50ff6ce20b3 100644
--- a/ctdb/tests/src/ctdb_transaction.c
+++ b/ctdb/tests/src/ctdb_transaction.c
@@ -19,13 +19,21 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
+#include "system/network.h"
-#include
-#include
+#include
+#include
+#include
+
+#include "lib/util/debug.h"
+#include "lib/util/time.h"
+
+#include "ctdb_logging.h"
+#include "ctdb_client.h"
+
+#include "common/cmdline.h"
static struct timeval tp1,tp2;
diff --git a/ctdb/tests/src/ctdb_traverse.c b/ctdb/tests/src/ctdb_traverse.c
index 37556dfc093..7dc347e59c4 100644
--- a/ctdb/tests/src/ctdb_traverse.c
+++ b/ctdb/tests/src/ctdb_traverse.c
@@ -18,13 +18,20 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
+#include "system/network.h"
-#include
-#include
+#include
+#include
+#include
+#include
+
+#include "lib/util/time.h"
+
+#include "common/cmdline.h"
+
+#include "ctdb_client.h"
static const char *dbname = "test.tdb";
diff --git a/ctdb/tests/src/ctdb_update_record.c b/ctdb/tests/src/ctdb_update_record.c
index f582c4c27e4..971afc73bd9 100644
--- a/ctdb/tests/src/ctdb_update_record.c
+++ b/ctdb/tests/src/ctdb_update_record.c
@@ -18,11 +18,20 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
+#include "system/network.h"
+
+#include
+#include
+#include
+
+#include "lib/util/time.h"
+
#include "ctdb_private.h"
+#include "ctdb_client.h"
+
+#include "common/cmdline.h"
static struct ctdb_db_context *ctdb_db;
diff --git a/ctdb/tests/src/ctdb_update_record_persistent.c b/ctdb/tests/src/ctdb_update_record_persistent.c
index 4781895bc71..ca138914fd7 100644
--- a/ctdb/tests/src/ctdb_update_record_persistent.c
+++ b/ctdb/tests/src/ctdb_update_record_persistent.c
@@ -18,12 +18,21 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "lib/tdb_wrap/tdb_wrap.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
+#include "system/network.h"
+
+#include
+#include
+#include
+
+#include "lib/tdb_wrap/tdb_wrap.h"
+#include "lib/util/time.h"
+
#include "ctdb_private.h"
+#include "ctdb_client.h"
+
+#include "common/cmdline.h"
static void update_once(struct ctdb_context *ctdb, struct tevent_context *ev,
diff --git a/ctdb/tests/src/ctdbd_test.c b/ctdb/tests/src/ctdbd_test.c
index 6a81cbd63ab..c2155f5fd70 100644
--- a/ctdb/tests/src/ctdbd_test.c
+++ b/ctdb/tests/src/ctdbd_test.c
@@ -20,8 +20,14 @@
#ifndef _CTDBD_TEST_C
#define _CTDBD_TEST_C
-#include "includes.h"
-#include "tdb.h"
+#include "replace.h"
+#include "system/network.h"
+
+#include
+/* Allow use of deprecated function tevent_loop_allow_nesting() */
+#define TEVENT_DEPRECATED
+#include
+
#include "ctdb_private.h"
/*
diff --git a/ctdb/tests/src/rb_test.c b/ctdb/tests/src/rb_test.c
index 44842e68a2f..283a3141abf 100644
--- a/ctdb/tests/src/rb_test.c
+++ b/ctdb/tests/src/rb_test.c
@@ -17,14 +17,17 @@
along with this program; if not, see .
*/
-#include "includes.h"
-#include "lib/util/dlinklist.h"
+#include "replace.h"
#include "system/filesys.h"
-#include "popt.h"
-#include "cmdline.h"
+#include "system/time.h"
-#include
-#include
+#include
+#include
+#include
+
+#include "lib/util/dlinklist.h"
+
+#include "common/cmdline.h"
#include "common/rb_tree.h"
static struct timeval tp1,tp2;
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 0447878dc36..4c6f8226713 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -18,19 +18,32 @@
along with this program; if not, see .
*/
-#include "includes.h"
+#include "replace.h"
#include "system/time.h"
#include "system/filesys.h"
#include "system/network.h"
#include "system/locale.h"
-#include "popt.h"
-#include "common/cmdline.h"
-#include "../include/ctdb_version.h"
-#include "../include/ctdb_client.h"
-#include "../include/ctdb_private.h"
-#include "../common/rb_tree.h"
+
+#include
+#include
+/* Allow use of deprecated function tevent_loop_allow_nesting() */
+#define TEVENT_DEPRECATED
+#include
+#include
+
#include "lib/tdb_wrap/tdb_wrap.h"
#include "lib/util/dlinklist.h"
+#include "lib/util/debug.h"
+#include "lib/util/substitute.h"
+#include "lib/util/time.h"
+
+#include "ctdb_logging.h"
+#include "../include/ctdb_version.h"
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+
+#include "common/cmdline.h"
+#include "common/rb_tree.h"
#include "common/system.h"
#define ERR_TIMEOUT 20 /* timed out trying to reach node */
diff --git a/ctdb/utils/pmda/pmda_ctdb.c b/ctdb/utils/pmda/pmda_ctdb.c
index ca897b16c21..13c2d6fea1f 100644
--- a/ctdb/utils/pmda/pmda_ctdb.c
+++ b/ctdb/utils/pmda/pmda_ctdb.c
@@ -19,14 +19,25 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include "replace.h"
+#include "system/network.h"
+
+#include
+#include
+
+#include "lib/util/time.h"
+
+#include "ctdb_private.h"
+#include "ctdb_client.h"
+#include "ctdb_protocol.h"
+
+#include "common/system.h"
+
#include
#include
#include
-#include "includes.h"
-#include "ctdb_private.h"
-#include "ctdb_protocol.h"
+
#include "domain.h"
-#include "common/system.h"
/*
* CTDB PMDA