s3:messaging: also recreate the local messaging backend in messaging_reinit()
authorStefan Metzmacher <metze@samba.org>
Wed, 14 Jan 2009 11:25:31 +0000 (12:25 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 19 Jan 2009 23:41:45 +0000 (00:41 +0100)
This prepares the change to use signal events in the tdb backend.

metze

source3/lib/messages.c

index f5933cafdbc0dab4209830a8b180123377c3789e..e4b20c7493493bce097fd354c2fb76e6f26bb0b2 100644 (file)
@@ -235,13 +235,21 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
  */
 NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
 {
-#ifdef CLUSTER_SUPPORT
+       NTSTATUS status;
+
+       TALLOC_FREE(msg_ctx->local);
+
+       status = messaging_tdb_init(msg_ctx, msg_ctx, &msg_ctx->local);
+       if (!NT_STATUS_IS_OK(status)) {
+               DEBUG(0, ("messaging_tdb_init failed: %s\n",
+                         nt_errstr(status)));
+               return status;
+       }
 
+#ifdef CLUSTER_SUPPORT
        TALLOC_FREE(msg_ctx->remote);
 
        if (lp_clustering()) {
-               NTSTATUS status;
-
                status = messaging_ctdbd_init(msg_ctx, msg_ctx,
                                              &msg_ctx->remote);