s3: Remove some calls to procid_self
authorVolker Lendecke <vl@samba.org>
Fri, 19 Oct 2012 05:15:31 +0000 (07:15 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 19 Oct 2012 18:39:56 +0000 (20:39 +0200)
The goal is to have procid_self handling completely in the messaging_context.

Signed-off-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Oct 19 20:39:56 CEST 2012 on sn-devel-104

source3/printing/spoolssd.c
source3/rpc_server/epmd.c
source3/rpc_server/lsasd.c

index bb043bdba7b8c59c0afade10ce459b2e826c8bb2..db303a1b0bd20ccd0da126d719492fa7602f45c5 100644 (file)
@@ -301,7 +301,7 @@ static bool spoolss_child_init(struct tevent_context *ev_ctx,
                return false;
        }
 
-       if (!serverid_register(procid_self(),
+       if (!serverid_register(messaging_server_id(msg_ctx),
                                FLAG_MSG_GENERAL |
                                FLAG_MSG_PRINT_GENERAL)) {
                return false;
@@ -671,7 +671,7 @@ pid_t start_spoolssd(struct tevent_context *ev_ctx,
        }
 
        /* save the parent process id so the children can use it later */
-       parent_id = procid_self();
+       parent_id = messaging_server_id(msg_ctx);
 
        spoolss_reopen_logs(0);
        pfh_daemon_config(DAEMON_NAME,
@@ -717,7 +717,7 @@ pid_t start_spoolssd(struct tevent_context *ev_ctx,
                exit(1);
        }
 
-       if (!serverid_register(procid_self(),
+       if (!serverid_register(messaging_server_id(msg_ctx),
                                FLAG_MSG_GENERAL |
                                FLAG_MSG_PRINT_GENERAL)) {
                exit(1);
index f30372edad95a818f12c7b526fb8fc2958891413..0e7b4302133be7f88bfe9068a970959de67cfe1e 100644 (file)
@@ -173,7 +173,7 @@ void start_epmd(struct tevent_context *ev_ctx,
        epmd_setup_sig_term_handler(ev_ctx);
        epmd_setup_sig_hup_handler(ev_ctx, msg_ctx);
 
-       ok = serverid_register(procid_self(),
+       ok = serverid_register(messaging_server_id(msg_ctx),
                               FLAG_MSG_GENERAL |
                               FLAG_MSG_PRINT_GENERAL);
        if (!ok) {
index fd6c248294abb896dbba6c0b2801a34ab4a1873b..a1ac49a47af9a041ff0489ec50e0944a05227b51 100644 (file)
@@ -261,7 +261,8 @@ static bool lsasd_child_init(struct tevent_context *ev_ctx,
                return false;
        }
 
-       if (!serverid_register(procid_self(), FLAG_MSG_GENERAL)) {
+       if (!serverid_register(messaging_server_id(msg_ctx),
+                              FLAG_MSG_GENERAL)) {
                return false;
        }
 
@@ -878,9 +879,6 @@ void start_lsasd(struct tevent_context *ev_ctx,
                return;
        }
 
-       /* save the parent process id so the children can use it later */
-       parent_id = procid_self();
-
        status = reinit_after_fork(msg_ctx,
                                   ev_ctx,
                                   true);
@@ -889,6 +887,9 @@ void start_lsasd(struct tevent_context *ev_ctx,
                smb_panic("reinit_after_fork() failed");
        }
 
+       /* save the parent process id so the children can use it later */
+       parent_id = messaging_server_id(msg_ctx);
+
        lsasd_reopen_logs(0);
        pfh_daemon_config(DAEMON_NAME,
                          &pf_lsasd_cfg,
@@ -920,7 +921,8 @@ void start_lsasd(struct tevent_context *ev_ctx,
                exit(1);
        }
 
-       if (!serverid_register(procid_self(), FLAG_MSG_GENERAL)) {
+       if (!serverid_register(messaging_server_id(msg_ctx),
+                              FLAG_MSG_GENERAL)) {
                exit(1);
        }