From 752bffc53fcf296f841d62ffbf8d424f9e8e66bd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 23 Feb 2010 15:04:10 +0100 Subject: [PATCH] s3: Consolidate server_id_self into the equivalent procid_self() --- source3/include/proto.h | 1 - source3/lib/util.c | 5 ----- source3/libsmb/dsgetdcname.c | 2 +- source3/nmbd/nmbd.c | 2 +- source3/smbd/server.c | 2 +- source3/smbd/service.c | 2 +- source3/torture/msgtest.c | 2 +- source3/torture/vfstest.c | 2 +- source3/utils/dbwrap_tool.c | 2 +- source3/utils/dbwrap_torture.c | 2 +- source3/utils/net_g_lock.c | 2 +- source3/utils/smbcontrol.c | 2 +- source3/winbindd/winbindd.c | 2 +- 13 files changed, 11 insertions(+), 17 deletions(-) diff --git a/source3/include/proto.h b/source3/include/proto.h index 63270e14fa4..ca1a38ba247 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1205,7 +1205,6 @@ void set_my_vnn(uint32 vnn); uint32 get_my_vnn(void); struct server_id pid_to_procid(pid_t pid); struct server_id procid_self(void); -struct server_id server_id_self(void); bool procid_equal(const struct server_id *p1, const struct server_id *p2); bool cluster_id_equal(const struct server_id *id1, const struct server_id *id2); diff --git a/source3/lib/util.c b/source3/lib/util.c index 932b5dbd405..f35a55fbed5 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2662,11 +2662,6 @@ struct server_id procid_self(void) return pid_to_procid(sys_getpid()); } -struct server_id server_id_self(void) -{ - return procid_self(); -} - bool procid_equal(const struct server_id *p1, const struct server_id *p2) { if (p1->pid != p2->pid) diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c index 76a52c8923a..00339d2d328 100644 --- a/source3/libsmb/dsgetdcname.c +++ b/source3/libsmb/dsgetdcname.c @@ -909,7 +909,7 @@ static struct messaging_context *msg_context(TALLOC_CTX *mem_ctx) { static struct messaging_context *ctx; - if (!ctx && !(ctx = messaging_init(mem_ctx, server_id_self(), + if (!ctx && !(ctx = messaging_init(mem_ctx, procid_self(), ev_context()))) { smb_panic("Could not init messaging context"); } diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 148361f9f93..22f5b971165 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -53,7 +53,7 @@ struct messaging_context *nmbd_messaging_context(void) static struct messaging_context *ctx; if (ctx == NULL) { - ctx = messaging_init(NULL, server_id_self(), + ctx = messaging_init(NULL, procid_self(), nmbd_event_context()); } if (ctx == NULL) { diff --git a/source3/smbd/server.c b/source3/smbd/server.c index ea1ef2ef89f..9d7de1637a0 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -60,7 +60,7 @@ struct messaging_context *smbd_messaging_context(void) { if (smbd_msg_ctx == NULL) { smbd_msg_ctx = messaging_init(talloc_autofree_context(), - server_id_self(), + procid_self(), smbd_event_context()); } if (smbd_msg_ctx == NULL) { diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 4bc5ca1a5cf..0452ef5e991 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -888,7 +888,7 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, on_err_call_dis_hook = true; if ((!conn->printer) && (!conn->ipc)) { - conn->notify_ctx = notify_init(conn, server_id_self(), + conn->notify_ctx = notify_init(conn, procid_self(), smbd_messaging_context(), smbd_event_context(), conn); diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index c447ac63d01..db9e5898b85 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -53,7 +53,7 @@ static void pong_message(struct messaging_context *msg_ctx, lp_load(get_dyn_CONFIGFILE(),False,False,False,True); if (!(evt_ctx = tevent_context_init(NULL)) || - !(msg_ctx = messaging_init(NULL, server_id_self(), evt_ctx))) { + !(msg_ctx = messaging_init(NULL, procid_self(), evt_ctx))) { fprintf(stderr, "could not init messaging context\n"); exit(1); } diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c index 2a191c2800a..d5237827d8e 100644 --- a/source3/torture/vfstest.c +++ b/source3/torture/vfstest.c @@ -492,7 +492,7 @@ struct messaging_context *smbd_messaging_context(void) { static struct messaging_context *ctx; - if (!ctx && !(ctx = messaging_init(NULL, server_id_self(), + if (!ctx && !(ctx = messaging_init(NULL, procid_self(), smbd_event_context()))) { smb_panic("Could not init smbd messaging context\n"); } diff --git a/source3/utils/dbwrap_tool.c b/source3/utils/dbwrap_tool.c index 38b39032650..6fbef5f1313 100644 --- a/source3/utils/dbwrap_tool.c +++ b/source3/utils/dbwrap_tool.c @@ -298,7 +298,7 @@ int main(int argc, const char **argv) goto done; } - msg_ctx = messaging_init(mem_ctx, server_id_self(), evt_ctx); + msg_ctx = messaging_init(mem_ctx, procid_self(), evt_ctx); if (msg_ctx == NULL) { d_fprintf(stderr, "ERROR: could not init messaging context\n"); goto done; diff --git a/source3/utils/dbwrap_torture.c b/source3/utils/dbwrap_torture.c index f96b8f176c5..04e17946c29 100644 --- a/source3/utils/dbwrap_torture.c +++ b/source3/utils/dbwrap_torture.c @@ -287,7 +287,7 @@ int main(int argc, const char *argv[]) goto done; } - msg_ctx = messaging_init(mem_ctx, server_id_self(), ev_ctx); + msg_ctx = messaging_init(mem_ctx, procid_self(), ev_ctx); if (msg_ctx == NULL) { d_fprintf(stderr, "ERROR: could not init messaging context\n"); goto done; diff --git a/source3/utils/net_g_lock.c b/source3/utils/net_g_lock.c index f30ed331be8..7632302cea9 100644 --- a/source3/utils/net_g_lock.c +++ b/source3/utils/net_g_lock.c @@ -35,7 +35,7 @@ static bool net_g_lock_init(TALLOC_CTX *mem_ctx, d_fprintf(stderr, "ERROR: could not init event context\n"); goto fail; } - msg = messaging_init(talloc_tos(), server_id_self(), ev); + msg = messaging_init(talloc_tos(), procid_self(), ev); if (msg == NULL) { d_fprintf(stderr, "ERROR: could not init messaging context\n"); goto fail; diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c index 4ccea26c3da..fc6e057f1c0 100644 --- a/source3/utils/smbcontrol.c +++ b/source3/utils/smbcontrol.c @@ -1388,7 +1388,7 @@ int main(int argc, const char **argv) * shell needs 0. */ if (!(evt_ctx = tevent_context_init(NULL)) || - !(msg_ctx = messaging_init(NULL, server_id_self(), evt_ctx))) { + !(msg_ctx = messaging_init(NULL, procid_self(), evt_ctx))) { fprintf(stderr, "could not init messaging context\n"); TALLOC_FREE(frame); exit(1); diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index e4c22a610af..e4df27b45e6 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -51,7 +51,7 @@ struct messaging_context *winbind_messaging_context(void) static struct messaging_context *ctx; if (ctx == NULL) { - ctx = messaging_init(NULL, server_id_self(), + ctx = messaging_init(NULL, procid_self(), winbind_event_context()); } if (ctx == NULL) { -- 2.11.4.GIT