summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-07-04 16:41:51 +0200
committerVolker Lendecke <vl@samba.org>2010-07-04 17:29:23 +0200
commit8cf1cd2d5c0469f170b0f81dda94a53ce8575af9 (patch)
treef206fa6bfadef3d50964ee3da1ada1119508ab08 /source3/lib
parent7f0e6df88345c1154f19fd263966ad20c73f5d52 (diff)
downloadsamba-8cf1cd2d5c0469f170b0f81dda94a53ce8575af9.tar.gz
samba-8cf1cd2d5c0469f170b0f81dda94a53ce8575af9.tar.bz2
samba-8cf1cd2d5c0469f170b0f81dda94a53ce8575af9.zip
s3: Use msg_ctx->id in messaging
This removes some references to procid_self() deep inside the code
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/messages_ctdbd.c2
-rw-r--r--source3/lib/messages_local.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/source3/lib/messages_ctdbd.c b/source3/lib/messages_ctdbd.c
index 847ab0fe6a..871334649d 100644
--- a/source3/lib/messages_ctdbd.c
+++ b/source3/lib/messages_ctdbd.c
@@ -80,7 +80,7 @@ static NTSTATUS messaging_ctdb_send(struct messaging_context *msg_ctx,
msg.msg_version = MESSAGE_VERSION;
msg.msg_type = msg_type;
msg.dest = pid;
- msg.src = procid_self();
+ msg.src = msg_ctx->id;
msg.buf = *data;
return ctdbd_messaging_send(ctx->conn, pid.vnn, pid.pid, &msg);
diff --git a/source3/lib/messages_local.c b/source3/lib/messages_local.c
index 15b2e47661..c475773a31 100644
--- a/source3/lib/messages_local.c
+++ b/source3/lib/messages_local.c
@@ -381,7 +381,7 @@ static NTSTATUS messaging_tdb_send(struct messaging_context *msg_ctx,
rec[msg_array->num_messages].msg_version = MESSAGE_VERSION;
rec[msg_array->num_messages].msg_type = msg_type & MSG_TYPE_MASK;
rec[msg_array->num_messages].dest = pid;
- rec[msg_array->num_messages].src = procid_self();
+ rec[msg_array->num_messages].src = msg_ctx->id;
rec[msg_array->num_messages].buf = *data;
msg_array->messages = rec;
@@ -408,15 +408,16 @@ static NTSTATUS messaging_tdb_send(struct messaging_context *msg_ctx,
}
/****************************************************************************
- Retrieve all messages for the current process.
+ Retrieve all messages for a process.
****************************************************************************/
static NTSTATUS retrieve_all_messages(TDB_CONTEXT *msg_tdb,
+ struct server_id id,
TALLOC_CTX *mem_ctx,
struct messaging_array **presult)
{
struct messaging_array *result;
- TDB_DATA key = message_key_pid(mem_ctx, procid_self());
+ TDB_DATA key = message_key_pid(mem_ctx, id);
NTSTATUS status;
if (tdb_chainlock(msg_tdb, key) == -1) {
@@ -464,7 +465,7 @@ static void message_dispatch(struct messaging_context *msg_ctx)
DEBUG(10, ("message_dispatch: received_messages = %d\n",
ctx->received_messages));
- status = retrieve_all_messages(tdb->tdb, NULL, &msg_array);
+ status = retrieve_all_messages(tdb->tdb, msg_ctx->id, NULL, &msg_array);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("message_dispatch: failed to retrieve messages: %s\n",
nt_errstr(status)));