From 58a4e3d58e51dc9830de9956cc168a978f4cca54 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 11 Nov 2011 12:41:24 +1100 Subject: [PATCH] Added some #ifndefs to stop files being included multiple times. Signed-off-by: Martin Schwenke (cherry picked from commit fdca12c25e6fce6206135b994dedf44265e4eb09) --- common/rb_tree.h | 7 +++++-- include/includes.h | 5 +++++ lib/util/db_wrap.h | 4 ++++ tcp/ctdb_tcp.h | 6 +++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/common/rb_tree.h b/common/rb_tree.h index 4f2ab22d..b5ddbb2a 100644 --- a/common/rb_tree.h +++ b/common/rb_tree.h @@ -17,8 +17,9 @@ along with this program; if not, see . */ - - +#ifndef _RB_TREE_H +#define _RB_TREE_H + #define TRBT_RED 0x00 #define TRBT_BLACK 0x01 typedef struct trbt_node { @@ -85,3 +86,5 @@ int trbt_traversearray32(trbt_tree_t *tree, uint32_t keylen, int (*callback)(voi /* Lookup the first node in the tree with a key based on an array of uint32 and return a pointer to data or NULL */ void *trbt_findfirstarray32(trbt_tree_t *tree, uint32_t keylen); + +#endif /* _RB_TREE_H */ diff --git a/include/includes.h b/include/includes.h index 43a6a5ff..667c12fb 100644 --- a/include/includes.h +++ b/include/includes.h @@ -1,3 +1,6 @@ +#ifndef _CTDB_INCLUDES_H +#define _CTDB_INCLUDES_H + #define HAVE_UNIXSOCKET 1 #include "replace.h" @@ -58,3 +61,5 @@ _PUBLIC_ int set_blocking(int fd, BOOL set); #include "lib/util/debug.h" #include "lib/util/util.h" + +#endif /* _CTDB_INCLUDES_H */ diff --git a/lib/util/db_wrap.h b/lib/util/db_wrap.h index 6ab93624..5ae5fd10 100644 --- a/lib/util/db_wrap.h +++ b/lib/util/db_wrap.h @@ -19,6 +19,8 @@ along with this program; if not, see . */ +#ifndef _DB_WRAP_H +#define _DB_WRAP_H struct tdb_wrap { struct tdb_context *tdb; @@ -30,3 +32,5 @@ struct tdb_wrap { struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx, const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode); + +#endif /* _DB_WRAP_H */ diff --git a/tcp/ctdb_tcp.h b/tcp/ctdb_tcp.h index 9a17bd6b..5b6b6516 100644 --- a/tcp/ctdb_tcp.h +++ b/tcp/ctdb_tcp.h @@ -17,7 +17,9 @@ along with this program; if not, see . */ - +#ifndef _CTDB_TCP_H +#define _CTDB_TCP_H + /* ctdb_tcp main state */ struct ctdb_tcp { struct ctdb_context *ctdb; @@ -54,3 +56,5 @@ void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data); void ctdb_tcp_stop_connection(struct ctdb_node *node); #define CTDB_TCP_ALIGNMENT 8 + +#endif /* _CTDB_TCP_H */ -- 2.34.1