summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/debug.c22
-rw-r--r--source3/lib/messages.c9
2 files changed, 14 insertions, 17 deletions
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
@@ -492,19 +492,6 @@ static void debug_message(int msg_type, struct server_id src,
}
/****************************************************************************
- 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;
}