summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-10-08 15:31:17 +0200
committerMichael Adam <obnox@samba.org>2014-03-24 17:09:10 +0100
commit1c96c068ad3869ca8411efbc07f82ae987ed2219 (patch)
tree00befeb15adb773d74e314d4114ac3bd411eee56 /source3/lib
parent4574602057d7645d673d1cddeb1941677b797f82 (diff)
downloadsamba-1c96c068ad3869ca8411efbc07f82ae987ed2219.tar.gz
samba-1c96c068ad3869ca8411efbc07f82ae987ed2219.tar.xz
samba-1c96c068ad3869ca8411efbc07f82ae987ed2219.zip
s3:serverid: use ctdb_serverids_exist_supported() runtime check
This is better than a compile time check for HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/serverid.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index 42598879479..b69671e4221 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -126,11 +126,13 @@ bool serverid_register(const struct server_id id, uint32_t msg_flags)
nt_errstr(status)));
goto done;
}
-#ifdef HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL
- if (lp_clustering()) {
+
+ if (lp_clustering() &&
+ ctdb_serverids_exist_supported(messaging_ctdbd_connection()))
+ {
register_with_ctdbd(messaging_ctdbd_connection(), id.unique_id);
}
-#endif
+
ret = true;
done:
TALLOC_FREE(rec);
@@ -341,8 +343,10 @@ bool serverids_exist(const struct server_id *ids, int num_ids, bool *results)
remote_num += 1;
}
-#ifdef HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL
- if (remote_num != 0) {
+#ifdef CLUSTER_SUPPORT
+ if (remote_num != 0 &&
+ ctdb_serverids_exist_supported(messaging_ctdbd_connection()))
+ {
int old_remote_num = remote_num;
remote_num = 0;