notifyd: Consolidate two #ifdef CLUSTER into one
authorVolker Lendecke <vl@samba.org>
Wed, 5 Jul 2017 07:34:51 +0000 (09:34 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 6 Jul 2017 22:52:24 +0000 (00:52 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/notifyd/notifyd.c

index 377d9535aa813a2b426cfee7ad058851a0612e13..fec9a5bd6cd3aa5bf3fadd755616a6db1e31d483 100644 (file)
@@ -241,18 +241,6 @@ struct tevent_req *notifyd_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
        }
        tevent_req_set_callback(subreq, notifyd_handler_done, req);
 
-#ifdef CLUSTER_SUPPORT
-       if (ctdbd_conn != NULL) {
-               subreq = messaging_handler_send(state, ev, msg_ctx,
-                                               MSG_SMB_NOTIFY_DB,
-                                               notifyd_got_db, state);
-               if (tevent_req_nomem(subreq, req)) {
-                       return tevent_req_post(req, ev);
-               }
-               tevent_req_set_callback(subreq, notifyd_handler_done, req);
-       }
-#endif
-
        names_db = messaging_names_db(msg_ctx);
 
        ret = server_id_db_set_exclusive(names_db, "notify-daemon");
@@ -273,6 +261,15 @@ struct tevent_req *notifyd_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
 
 #ifdef CLUSTER_SUPPORT
        if (ctdbd_conn != NULL) {
+
+               subreq = messaging_handler_send(state, ev, msg_ctx,
+                                               MSG_SMB_NOTIFY_DB,
+                                               notifyd_got_db, state);
+               if (tevent_req_nomem(subreq, req)) {
+                       return tevent_req_post(req, ev);
+               }
+               tevent_req_set_callback(subreq, notifyd_handler_done, req);
+
                state->log = talloc_zero(state, struct messaging_reclog);
                if (tevent_req_nomem(state->log, req)) {
                        return tevent_req_post(req, ev);