s3: Re-initialize the server_id in messaging_reinit
authorVolker Lendecke <vl@samba.org>
Sun, 4 Jul 2010 14:18:12 +0000 (16:18 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 4 Jul 2010 15:29:23 +0000 (17:29 +0200)
source3/include/messages.h
source3/lib/messages.c
source3/lib/util.c

index 865ffd48220586e2f8e4e223592ec84f81c2ed06..805889a805dab6f9a7f3fa3d7858e26a2e75e80a 100644 (file)
@@ -130,7 +130,8 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
 /*
  * re-init after a fork
  */
-NTSTATUS messaging_reinit(struct messaging_context *msg_ctx);
+NTSTATUS messaging_reinit(struct messaging_context *msg_ctx,
+                         struct server_id id);
 
 NTSTATUS messaging_register(struct messaging_context *msg_ctx,
                            void *private_data,
index 2fcdc24179191f2edd5e48329a95856deaff5630..d53297e502752d06850515cfed9c73b029c108db 100644 (file)
@@ -226,12 +226,15 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
 /*
  * re-init after a fork
  */
-NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
+NTSTATUS messaging_reinit(struct messaging_context *msg_ctx,
+                         struct server_id id)
 {
        NTSTATUS status;
 
        TALLOC_FREE(msg_ctx->local);
 
+       msg_ctx->id = id;
+
        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",
index d7e765d1aff279b85c763b0e7ee7a066db0ebe62..1467c5445da12b18060c51086878718e22aa698d 100644 (file)
@@ -872,8 +872,8 @@ void smb_msleep(unsigned int t)
 }
 
 NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
-                      struct event_context *ev_ctx,
-                      bool parent_longlived)
+                          struct event_context *ev_ctx,
+                          bool parent_longlived)
 {
        NTSTATUS status = NT_STATUS_OK;
 
@@ -899,7 +899,7 @@ NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
                 * For clustering, we need to re-init our ctdbd connection after the
                 * fork
                 */
-               status = messaging_reinit(msg_ctx);
+               status = messaging_reinit(msg_ctx, procid_self());
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0,("messaging_reinit() failed: %s\n",
                                 nt_errstr(status)));