diff options
author | Volker Lendecke <vl@samba.org> | 2010-07-04 16:41:51 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-07-04 17:29:23 +0200 |
commit | 8cf1cd2d5c0469f170b0f81dda94a53ce8575af9 (patch) | |
tree | f206fa6bfadef3d50964ee3da1ada1119508ab08 | |
parent | 7f0e6df88345c1154f19fd263966ad20c73f5d52 (diff) | |
download | samba-8cf1cd2d5c0469f170b0f81dda94a53ce8575af9.tar.gz samba-8cf1cd2d5c0469f170b0f81dda94a53ce8575af9.tar.xz samba-8cf1cd2d5c0469f170b0f81dda94a53ce8575af9.zip |
s3: Use msg_ctx->id in messaging
This removes some references to procid_self() deep inside the code
-rw-r--r-- | source3/lib/messages_ctdbd.c | 2 | ||||
-rw-r--r-- | source3/lib/messages_local.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/source3/lib/messages_ctdbd.c b/source3/lib/messages_ctdbd.c index 847ab0fe6a9..871334649db 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 15b2e476614..c475773a31f 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))); |