summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-05-15 15:14:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:22:07 -0500
commit84758bd1f8633d3efe30e293887596db6bfd5e5b (patch)
treea7b952b9aa3820a51cc085090364cb066c72c927 /source3/lib
parentb759f7c09aebd56711888a75e7902d845c12b2e2 (diff)
downloadsamba-84758bd1f8633d3efe30e293887596db6bfd5e5b.tar.gz
samba-84758bd1f8633d3efe30e293887596db6bfd5e5b.tar.bz2
samba-84758bd1f8633d3efe30e293887596db6bfd5e5b.zip
r22908: All callers of message_init now also call messaging_init. Unify those.
(This used to be commit 330946ad2307ca34f0a8d068a0193fcb8a0d6036)
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;
}