diff options
author | Volker Lendecke <vl@samba.org> | 2017-07-05 09:37:14 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2017-07-07 00:52:24 +0200 |
commit | b8dccd11ea3d43b9ee51811c1ce7d81b91a549ca (patch) | |
tree | 8e73f6efaffdaa0b7222768b32b6c86964194f8e /source3/smbd/notifyd | |
parent | d0a7bccae9856aba44a057c09499aa0de6b21862 (diff) | |
download | samba-b8dccd11ea3d43b9ee51811c1ce7d81b91a549ca.tar.gz |
notifyd: Avoid an if-expression
Best reviewed with "git show -b -U10"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd/notifyd')
-rw-r--r-- | source3/smbd/notifyd/notifyd.c | 69 |
1 files changed, 33 insertions, 36 deletions
diff --git a/source3/smbd/notifyd/notifyd.c b/source3/smbd/notifyd/notifyd.c index fec9a5bd6cd..2b70371b4d9 100644 --- a/source3/smbd/notifyd/notifyd.c +++ b/source3/smbd/notifyd/notifyd.c @@ -260,46 +260,43 @@ 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); + 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); - } + state->log = talloc_zero(state, struct messaging_reclog); + if (tevent_req_nomem(state->log, req)) { + return tevent_req_post(req, ev); + } - subreq = notifyd_broadcast_reclog_send( - state->log, ev, ctdbd_conn, - messaging_server_id(msg_ctx), - state->log); - if (tevent_req_nomem(subreq, req)) { - return tevent_req_post(req, ev); - } - tevent_req_set_callback(subreq, - notifyd_broadcast_reclog_finished, - req); + subreq = notifyd_broadcast_reclog_send( + state->log, ev, ctdbd_conn, + messaging_server_id(msg_ctx), + state->log); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, + notifyd_broadcast_reclog_finished, + req); - subreq = notifyd_clean_peers_send(state, ev, state); - if (tevent_req_nomem(subreq, req)) { - return tevent_req_post(req, ev); - } - tevent_req_set_callback(subreq, notifyd_clean_peers_finished, - req); + subreq = notifyd_clean_peers_send(state, ev, state); + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); + } + tevent_req_set_callback(subreq, notifyd_clean_peers_finished, + req); - ret = register_with_ctdbd(ctdbd_conn, - CTDB_SRVID_SAMBA_NOTIFY_PROXY, - notifyd_snoop_broadcast, state); - if (ret != 0) { - tevent_req_error(req, ret); - return tevent_req_post(req, ev); - } + ret = register_with_ctdbd(ctdbd_conn, + CTDB_SRVID_SAMBA_NOTIFY_PROXY, + notifyd_snoop_broadcast, state); + if (ret != 0) { + tevent_req_error(req, ret); + return tevent_req_post(req, ev); } #endif |