s3:dbwrap: do not burden the user of db_open_ctdb with ifdef voodoo
authorGregor Beck <gbeck@sernet.de>
Tue, 25 Oct 2011 14:32:12 +0000 (16:32 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 25 Nov 2011 12:24:34 +0000 (13:24 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
source3/lib/dbwrap/dbwrap_ctdb.c
source3/lib/dbwrap/dbwrap_ctdb.h

index 38a339536e31486d093ddd4217e63ef6239a0a0e..aae5c065f658ab3131fadc8244ae488f05c5786e 100644 (file)
@@ -22,6 +22,7 @@
 #include "system/filesys.h"
 #include "lib/util/tdb_wrap.h"
 #include "util_tdb.h"
+#include "dbwrap/dbwrap_ctdb.h"
 #include "dbwrap/dbwrap_rbt.h"
 #include "lib/param/param.h"
 
@@ -1526,4 +1527,16 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
 
        return result;
 }
+
+#else /* CLUSTER_SUPPORT */
+
+struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
+                               const char *name,
+                               int hash_size, int tdb_flags,
+                               int open_flags, mode_t mode)
+{
+       DEBUG(3, ("db_open_ctdb: no cluster support!\n"));
+       return NULL;
+}
+
 #endif
index 13ce1404895b5b09d3d15a533e1f6bea3a4ac6e3..7898818ae464668f4ea319542ea2f25474ee718d 100644 (file)
@@ -21,8 +21,6 @@
 #ifndef __DBWRAP_CTDB_H__
 #define __DBWRAP_CTDB_H__
 
-#ifdef CLUSTER_SUPPORT
-
 #include <talloc.h>
 
 struct db_context;
@@ -31,6 +29,5 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
                                const char *name,
                                int hash_size, int tdb_flags,
                                int open_flags, mode_t mode);
-#endif /* CLUSTER_SUPPORT */
 
 #endif /* __DBWRAP_CTDB_H__ */