summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-10-04 11:21:18 +0200
committerStefan Metzmacher <metze@samba.org>2015-02-13 23:32:07 +0100
commitf4cd1eb42487efde580de74e975a9e7cc67e03ea (patch)
tree9bcf5307d734c4876e123248999b80a7458c588f /source3/lib
parent0108c2921d5b604da42ba70b1f38cda16fd071f7 (diff)
downloadsamba-f4cd1eb42487efde580de74e975a9e7cc67e03ea.tar.gz
samba-f4cd1eb42487efde580de74e975a9e7cc67e03ea.tar.xz
samba-f4cd1eb42487efde580de74e975a9e7cc67e03ea.zip
messaging3: Use messaging_dgm_ref
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/messages.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index cdd6b05357..454906a72a 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -54,6 +54,7 @@
#include "lib/messages_dgm.h"
#include "lib/iov_buf.h"
#include "lib/util/server_id_db.h"
+#include "lib/messages_dgm_ref.h"
struct messaging_callback {
struct messaging_callback *prev, *next;
@@ -75,6 +76,7 @@ struct messaging_context {
struct tevent_req **waiters;
unsigned num_waiters;
+ void *msg_dgm_ref;
struct messaging_backend *remote;
struct server_id_db *names_db;
@@ -341,12 +343,12 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
return NULL;
}
- ret = messaging_dgm_init(ctx->event_ctx, ctx->id.unique_id,
- priv_path, lck_path,
- messaging_recv_cb, ctx);
+ ctx->msg_dgm_ref = messaging_dgm_ref(
+ ctx, ctx->event_ctx, ctx->id.unique_id,
+ priv_path, lck_path, messaging_recv_cb, ctx, &ret);
- if (ret != 0) {
- DEBUG(2, ("messaging_dgm_init failed: %s\n", strerror(ret)));
+ if (ctx->msg_dgm_ref == NULL) {
+ DEBUG(2, ("messaging_dgm_ref failed: %s\n", strerror(ret)));
TALLOC_FREE(ctx);
return NULL;
}
@@ -398,15 +400,17 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
NTSTATUS status;
int ret;
- messaging_dgm_destroy();
+ TALLOC_FREE(msg_ctx->msg_dgm_ref);
msg_ctx->id = procid_self();
- ret = messaging_dgm_init(msg_ctx->event_ctx, msg_ctx->id.unique_id,
- private_path("sock"), lock_path("msg"),
- messaging_recv_cb, msg_ctx);
- if (ret != 0) {
- DEBUG(0, ("messaging_dgm_init failed: %s\n", strerror(errno)));
+ msg_ctx->msg_dgm_ref = messaging_dgm_ref(
+ msg_ctx, msg_ctx->event_ctx, msg_ctx->id.unique_id,
+ private_path("sock"), lock_path("msg"),
+ messaging_recv_cb, msg_ctx, &ret);
+
+ if (msg_ctx->msg_dgm_ref == NULL) {
+ DEBUG(2, ("messaging_dgm_ref failed: %s\n", strerror(ret)));
return map_nt_error_from_unix(ret);
}