summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-01-30 04:37:18 +0000
committerTim Potter <tpot@samba.org>2003-01-30 04:37:18 +0000
commit97027aa5ff4ba6bb05f66458e9b8db98c194c619 (patch)
treeda86ece6e93de2cdbc7de697b2b5eca5962b9f7d /source3/lib
parentb61f89826f2b7ee8ca7bd388b66c3f5b78ed3e60 (diff)
downloadsamba-97027aa5ff4ba6bb05f66458e9b8db98c194c619.tar.gz
samba-97027aa5ff4ba6bb05f66458e9b8db98c194c619.tar.bz2
samba-97027aa5ff4ba6bb05f66458e9b8db98c194c619.zip
Merge of REQ_DEBUGLEVEL messaging and debug_count fixes from HEAD.
(This used to be commit abb112ba2ad362036c7b3f340d5f64d6fcc0cd3c)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/debug.c19
-rw-r--r--source3/lib/messages.c11
2 files changed, 7 insertions, 23 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 23442a0193..dc675037a0 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -467,26 +467,19 @@ void debug_message_send(pid_t pid, const char *params_str)
False);
}
-
-#if 0
/****************************************************************************
Return current debug level.
****************************************************************************/
static void debuglevel_message(int msg_type, pid_t src, void *buf, size_t len)
{
- char *debug_level_classes;
+ char *message = debug_list_class_names_and_levels();
+
DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %u\n",(unsigned int)src));
+ message_send_pid(src, MSG_DEBUGLEVEL, message, strlen(message) + 1, True);
- 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"));
- }
+ SAFE_FREE(message);
}
-#endif
/****************************************************************************
Init debugging (one time stuff)
@@ -627,7 +620,7 @@ BOOL need_to_check_log_size( void )
{
int maxlog;
- if( debug_count++ < 100 )
+ if( debug_count < 100 )
return( False );
maxlog = lp_max_log_size() * 1024;
@@ -712,6 +705,8 @@ void check_log_size( void )
va_list ap;
int old_errno = errno;
+ debug_count++;
+
if( stdout_logging )
{
va_start( ap, format_str );
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 38c3c411d4..53c9e3d2bc 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -91,16 +91,6 @@ static 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)
-{
- DEBUG(1,("INFO: Received REQ_DEBUGLEVEL message from PID %u\n",(unsigned int)src));
- message_send_pid(src, MSG_DEBUGLEVEL, DEBUGLEVEL_CLASS, sizeof(DEBUGLEVEL_CLASS), True);
-}
-
-/****************************************************************************
Initialise the messaging functions.
****************************************************************************/
@@ -120,7 +110,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;
}