From 84758bd1f8633d3efe30e293887596db6bfd5e5b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 15 May 2007 15:14:32 +0000 Subject: r22908: All callers of message_init now also call messaging_init. Unify those. (This used to be commit 330946ad2307ca34f0a8d068a0193fcb8a0d6036) --- source3/lib/debug.c | 22 ++++++---------------- source3/lib/messages.c | 9 ++++++++- 2 files changed, 14 insertions(+), 17 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/debug.c b/source3/lib/debug.c index d231f55585..5ef07f806b 100644 --- a/source3/lib/debug.c +++ b/source3/lib/debug.c @@ -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 **************************************************************************/ diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 16d3a61343..63c136db61 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -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; } -- cgit