lib: Push down unique generation one level
[obnox/samba/samba-obnox.git] / source3 / lib / messages.c
index 9025d7b0cd9397c65a51c8ac00e633d8df2d52d3..ef8e83dd6e61fa6b13133dd6ffde4cec8d5e97e3 100644 (file)
@@ -303,7 +303,6 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
        ctx->id = (struct server_id) {
                .pid = getpid(), .vnn = NONCLUSTER_VNN
        };
-       ctx->id.unique_id = serverid_get_random_unique_id();
 
        ctx->event_ctx = ev;
 
@@ -340,7 +339,7 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
        }
 
        ctx->msg_dgm_ref = messaging_dgm_ref(
-               ctx, ctx->event_ctx, ctx->id.unique_id,
+               ctx, ctx->event_ctx, &ctx->id.unique_id,
                priv_path, lck_path, messaging_recv_cb, ctx, &ret);
 
        if (ctx->msg_dgm_ref == NULL) {
@@ -400,10 +399,9 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
        msg_ctx->id = (struct server_id) {
                .pid = getpid(), .vnn = msg_ctx->id.vnn
        };
-       msg_ctx->id.unique_id = serverid_get_random_unique_id();
 
        msg_ctx->msg_dgm_ref = messaging_dgm_ref(
-               msg_ctx, msg_ctx->event_ctx, msg_ctx->id.unique_id,
+               msg_ctx, msg_ctx->event_ctx, &msg_ctx->id.unique_id,
                private_path("msg.sock"), lock_path("msg.lock"),
                messaging_recv_cb, msg_ctx, &ret);