diff options
author | Simo Sorce <idra@samba.org> | 2002-05-26 11:28:38 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2002-05-26 11:28:38 +0000 |
commit | 34728ec659751f2e14cfb8502300f3fdb96d405a (patch) | |
tree | 950f926a5d91c8ed9fa7bc5f5bdcca4349b72439 /source3/lib | |
parent | ba0b423dfa02b57d66a41ba0cf7dffad00ee19d1 (diff) | |
download | samba-34728ec659751f2e14cfb8502300f3fdb96d405a.tar.gz samba-34728ec659751f2e14cfb8502300f3fdb96d405a.tar.bz2 samba-34728ec659751f2e14cfb8502300f3fdb96d405a.zip |
move debug stuff from messages.c to debug.c (Elrond)
(This used to be commit 44df5a13bc83dc331caa6788cf0805333ed79f8d)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/debug.c | 19 | ||||
-rw-r--r-- | source3/lib/messages.c | 21 |
2 files changed, 20 insertions, 20 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c index dc1a55fb58..1b2f9ac350 100644 --- a/source3/lib/debug.c +++ b/source3/lib/debug.c @@ -468,6 +468,24 @@ void debug_message_send(pid_t pid, const char *params_str) /**************************************************************************** + Return current debug level. +****************************************************************************/ + +static void debuglevel_message(int msg_type, pid_t src, void *buf, size_t len) +{ + char *debug_level_classes; + DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %u\n",(unsigned int)src)); + + if ((debug_level_classes = debug_list_class_names_and_levels())) { + /*{ debug_level_classes = "test:1000";*/ + message_send_pid(src, MSG_DEBUGLEVEL, debug_level_classes, strlen(debug_level_classes) + 1, True); + SAFE_FREE(debug_level_classes); + } else { + DEBUG(0, ("debuglevel_message: error retrieving class levels!\n")); + } +} + +/**************************************************************************** Init debugging (one time stuff) ****************************************************************************/ void debug_init(void) @@ -481,6 +499,7 @@ void debug_init(void) initialised = True; message_register(MSG_DEBUG, debug_message); + message_register(MSG_REQ_DEBUGLEVEL, debuglevel_message); for(p = default_classname_table; *p; p++) { diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 38d5e4af92..c06644bc86 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -79,7 +79,7 @@ static void sig_usr1(void) A useful function for testing the message system. ****************************************************************************/ -void ping_message(int msg_type, pid_t src, void *buf, size_t len) +static void ping_message(int msg_type, pid_t src, void *buf, size_t len) { char *msg = buf ? buf : "none"; DEBUG(1,("INFO: Received PING message from PID %u [%s]\n",(unsigned int)src, msg)); @@ -87,24 +87,6 @@ void ping_message(int msg_type, pid_t src, void *buf, size_t len) } /**************************************************************************** - Return current debug level. -****************************************************************************/ - -void debuglevel_message(int msg_type, pid_t src, void *buf, size_t len) -{ - char *debug_level_classes; - DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %u\n",(unsigned int)src)); - - if ((debug_level_classes = debug_list_class_names_and_levels())) { - /*{ debug_level_classes = "test:1000";*/ - message_send_pid(src, MSG_DEBUGLEVEL, debug_level_classes, strlen(debug_level_classes) + 1, True); - SAFE_FREE(debug_level_classes); - } else { - DEBUG(0, ("debuglevel_message: error retrieving class levels!\n")); - } -} - -/**************************************************************************** Initialise the messaging functions. ****************************************************************************/ @@ -124,7 +106,6 @@ BOOL message_init(void) CatchSignal(SIGUSR1, SIGNAL_CAST sig_usr1); message_register(MSG_PING, ping_message); - message_register(MSG_REQ_DEBUGLEVEL, debuglevel_message); return True; } |