From bff27ee7837861d8c3fd8fef7ed7411944be575b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 25 Jul 2014 11:03:11 +0000 Subject: [PATCH] messaging3: Only store the pid in messaging_dgm_context That's all we need here Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/lib/messages_dgm.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c index 2f85b3d7697..49073fbc035 100644 --- a/source3/lib/messages_dgm.c +++ b/source3/lib/messages_dgm.c @@ -28,7 +28,7 @@ #include "unix_msg/unix_msg.h" struct messaging_dgm_context { - struct server_id pid; + pid_t pid; struct poll_funcs *msg_callbacks; void *tevent_handle; struct unix_msg_ctx *dgm_ctx; @@ -199,7 +199,7 @@ int messaging_dgm_init(TALLOC_CTX *mem_ctx, if (ctx == NULL) { goto fail_nomem; } - ctx->pid = pid; + ctx->pid = pid.pid; ctx->recv_cb = recv_cb; ctx->recv_cb_private_data = recv_cb_private_data; @@ -274,16 +274,14 @@ fail_nomem: static int messaging_dgm_context_destructor(struct messaging_dgm_context *c) { - struct server_id pid = c->pid; - /* * First delete the socket to avoid races. The lockfile is the * indicator that we're still around. */ unix_msg_free(c->dgm_ctx); - if (getpid() == pid.pid) { - (void)messaging_dgm_lockfile_remove(c, c->cache_dir, pid.pid); + if (getpid() == c->pid) { + (void)messaging_dgm_lockfile_remove(c, c->cache_dir, c->pid); } close(c->lockfile_fd);