1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-30 06:50:24 +03:00

r22908: All callers of message_init now also call messaging_init. Unify those.

(This used to be commit 330946ad2307ca34f0a8d068a0193fcb8a0d6036)
This commit is contained in:
Volker Lendecke 2007-05-15 15:14:32 +00:00 committed by Gerald (Jerry) Carter
parent b759f7c09a
commit 84758bd1f8
8 changed files with 16 additions and 28 deletions

View File

@ -491,19 +491,6 @@ static void debug_message(int msg_type, struct server_id src,
debug_parse_levels(params_str);
}
/****************************************************************************
Send a "set debug level" message.
****************************************************************************/
void debug_message_send(pid_t pid, const char *params_str)
{
if (!params_str)
return;
message_send_pid(pid_to_procid(pid), MSG_DEBUG,
params_str, strlen(params_str) + 1,
False);
}
/****************************************************************************
Return current debug level.
****************************************************************************/
@ -539,14 +526,17 @@ void debug_init(void)
initialised = True;
message_register(MSG_DEBUG, debug_message, NULL);
message_register(MSG_REQ_DEBUGLEVEL, debuglevel_message, NULL);
for(p = default_classname_table; *p; p++) {
debug_add_class(*p);
}
}
void debug_register_msgs(void)
{
message_register(MSG_DEBUG, debug_message, NULL);
message_register(MSG_REQ_DEBUGLEVEL, debuglevel_message, NULL);
}
/***************************************************************************
Get ready for syslog stuff
**************************************************************************/

View File

@ -117,7 +117,7 @@ static void ping_message(int msg_type, struct server_id src,
Initialise the messaging functions.
****************************************************************************/
BOOL message_init(void)
static BOOL message_init(struct messaging_context *msg_ctx)
{
sec_init();
@ -144,6 +144,7 @@ BOOL message_init(void)
register_msg_pool_usage();
register_dmalloc_msgs();
debug_register_msgs();
return True;
}
@ -757,6 +758,12 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
ctx->id = server_id;
talloc_set_destructor(ctx, messaging_context_destructor);
if (!message_init(ctx)) {
DEBUG(0, ("message_init failed: %s\n", strerror(errno)));
TALLOC_FREE(ctx);
}
return ctx;
}

View File

@ -45,9 +45,6 @@ BOOL cli_send_mailslot(struct messaging_context *msg_ctx,
return False;
}
if (!message_init())
return False;
memset((char *)&p, '\0', sizeof(p));
/*

View File

@ -753,7 +753,6 @@ static BOOL open_sockets(enum smb_server_mode server_mode, int port)
setpgid( (pid_t)0, (pid_t)0 );
#endif
message_init();
if (nmbd_messaging_context() == NULL) {
return 1;
}

View File

@ -1125,7 +1125,7 @@ int main(int argc, char **argv, char **envp)
/* Initialise messaging system */
if (!message_init()) {
if (winbind_messaging_context() == NULL) {
DEBUG(0, ("unable to initialize messaging system\n"));
exit(1);
}

View File

@ -967,7 +967,7 @@ extern void build_options(BOOL screen);
}
/* Setup all the TDB's - including CLEAR_IF_FIRST tdb's. */
if (!message_init())
if (smbd_messaging_context() == NULL)
exit(1);
/* Initialise the password backed before the global_sam_sid

View File

@ -52,8 +52,6 @@ static void pong_message(struct messaging_context *msg_ctx,
lp_load(dyn_CONFIGFILE,False,False,False,True);
message_init();
if (!(evt_ctx = event_context_init(NULL)) ||
!(msg_ctx = messaging_init(NULL, server_id_self(), evt_ctx))) {
fprintf(stderr, "could not init messaging context\n");

View File

@ -55,9 +55,6 @@ static BOOL send_message(struct messaging_context *msg_ctx,
BOOL ret;
int n_sent = 0;
if (!message_init())
return False;
if (procid_to_pid(&pid) != 0)
return NT_STATUS_IS_OK(
messaging_send_buf(msg_ctx, pid, msg_type,