summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-07-17 09:52:28 +0000
committerJeremy Allison <jra@samba.org>2014-08-11 23:57:12 +0200
commit706ba593d672775c28b6dfa4bd65fdd1e5a6fb4a (patch)
tree58b71c8a80c824dc71e3f40818461058f312ea9b
parent371e99959cf8c02b3a4e7b6352ed83f1d8b9200d (diff)
downloadsamba-706ba593d672775c28b6dfa4bd65fdd1e5a6fb4a.tar.gz
samba-706ba593d672775c28b6dfa4bd65fdd1e5a6fb4a.tar.xz
samba-706ba593d672775c28b6dfa4bd65fdd1e5a6fb4a.zip
messaging3: Explicitly pass tevent_context to messaging_dgm_init
One dependency less on messaging_context() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/include/messages.h1
-rw-r--r--source3/lib/messages.c5
-rw-r--r--source3/lib/messages_dgm.c4
3 files changed, 6 insertions, 4 deletions
diff --git a/source3/include/messages.h b/source3/include/messages.h
index 32c4097a6b..4cc9053641 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -75,6 +75,7 @@ struct messaging_backend {
int messaging_dgm_init(struct messaging_context *msg_ctx,
TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
struct messaging_backend **presult,
void (*recv_cb)(int msg_type,
struct server_id src,
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 2e80bab4c7..33fd45eef7 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -244,7 +244,7 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
ctx->event_ctx = ev;
ctx->have_context = &have_context;
- ret = messaging_dgm_init(ctx, ctx, &ctx->local,
+ ret = messaging_dgm_init(ctx, ctx, ctx->event_ctx, &ctx->local,
messaging_recv_cb, ctx);
if (ret != 0) {
@@ -303,7 +303,8 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
msg_ctx->id = procid_self();
- ret = messaging_dgm_init(msg_ctx, msg_ctx, &msg_ctx->local,
+ ret = messaging_dgm_init(msg_ctx, msg_ctx, msg_ctx->event_ctx,
+ &msg_ctx->local,
messaging_recv_cb, msg_ctx);
if (ret != 0) {
DEBUG(0, ("messaging_dgm_init failed: %s\n", strerror(errno)));
diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c
index 0025ad5fab..69ea5985ac 100644
--- a/source3/lib/messages_dgm.c
+++ b/source3/lib/messages_dgm.c
@@ -173,6 +173,7 @@ static int messaging_dgm_lockfile_remove(TALLOC_CTX *tmp_ctx,
int messaging_dgm_init(struct messaging_context *msg_ctx,
TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
struct messaging_backend **presult,
void (*recv_cb)(int msg_type,
struct server_id src,
@@ -249,8 +250,7 @@ int messaging_dgm_init(struct messaging_context *msg_ctx,
}
ctx->tevent_handle = poll_funcs_tevent_register(
- ctx, ctx->msg_callbacks,
- messaging_tevent_context(msg_ctx));
+ ctx, ctx->msg_callbacks, ev);
if (ctx->tevent_handle == NULL) {
goto fail_nomem;
}