From 90a2246aac4a441ffc2ff6c5165c6de4c2c4123f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 9 Aug 2014 17:18:04 +0200 Subject: [PATCH] messaging3: Remove one-context protection from messages.c messages_dgm.c takes care of it. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/lib/messages.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 37953ba8169..12419f89e21 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -75,12 +75,8 @@ struct messaging_context { struct messaging_dgm_context *local; struct messaging_backend *remote; - - bool *have_context; }; -static int messaging_context_destructor(struct messaging_context *msg_ctx); - /**************************************************************************** A useful function for testing the message system. ****************************************************************************/ @@ -229,13 +225,6 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, struct messaging_context *ctx; NTSTATUS status; int ret; - static bool have_context = false; - - if (have_context) { - DEBUG(0, ("No two messaging contexts per process\n")); - return NULL; - } - if (!(ctx = talloc_zero(mem_ctx, struct messaging_context))) { return NULL; @@ -243,7 +232,6 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, ctx->id = procid_self(); ctx->event_ctx = ev; - ctx->have_context = &have_context; sec_init(); @@ -277,19 +265,9 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, register_dmalloc_msgs(ctx); debug_register_msgs(ctx); - have_context = true; - talloc_set_destructor(ctx, messaging_context_destructor); - return ctx; } -static int messaging_context_destructor(struct messaging_context *msg_ctx) -{ - SMB_ASSERT(*msg_ctx->have_context); - *msg_ctx->have_context = false; - return 0; -} - struct server_id messaging_server_id(const struct messaging_context *msg_ctx) { return msg_ctx->id; -- 2.34.1