From 505d420df1ae4c7333744c8cf320f40ac37ba777 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 26 Apr 2019 13:21:15 +0200 Subject: [PATCH 1/2] lib/util: fix call to dbghdrclass() for DEBUGC() dbghdrclass() sets the global 'current_msg_class' and for that DEBUGC() should pass the given dbgc_class instead of the per file DBGC_CLASS. This is important with the new per class logfile with: log level = 1 dsdb_audit:10@/var/log/samba/log.dsdb_audit BUG: https://bugzilla.samba.org/show_bug.cgi?id=13915 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme (similar to commit bb0ffbf38cb1955c9e400003add680eabcf706a6) --- lib/util/debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/debug.h b/lib/util/debug.h index 2895d1578875..fd2c18791b5a 100644 --- a/lib/util/debug.h +++ b/lib/util/debug.h @@ -201,7 +201,7 @@ extern int *DEBUGLEVEL_CLASS; #define DEBUGC( dbgc_class, level, body ) \ (void)( ((level) <= MAX_DEBUG_LEVEL) && \ unlikely(DEBUGLEVEL_CLASS[ dbgc_class ] >= (level)) \ - && (dbghdrclass( level, DBGC_CLASS, __location__, __FUNCTION__ )) \ + && (dbghdrclass( level, dbgc_class, __location__, __FUNCTION__ )) \ && (dbgtext body) ) #define DEBUGADD( level, body ) \ -- 2.17.1 From 9ed18db4b660fa24463fd811631356c6644efb82 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 26 Apr 2019 13:32:43 +0200 Subject: [PATCH 2/2] lib/util: remove unused prototypes in debug.h BUG: https://bugzilla.samba.org/show_bug.cgi?id=13915 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme (cherry picked from commit d98a971247450d494c581c5454e6c270ad1b6880) --- lib/util/debug.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/util/debug.h b/lib/util/debug.h index fd2c18791b5a..188e6b647d37 100644 --- a/lib/util/debug.h +++ b/lib/util/debug.h @@ -45,7 +45,6 @@ bool dbgtext_va(const char *, va_list ap) PRINTF_ATTRIBUTE(1,0); bool dbgtext( const char *, ... ) PRINTF_ATTRIBUTE(1,2); bool dbghdrclass( int level, int cls, const char *location, const char *func); -bool dbghdr( int level, const char *location, const char *func); /* * Redefine DEBUGLEVEL because so we don't have to change every source file @@ -318,7 +317,6 @@ void force_check_log_size( void ); bool need_to_check_log_size( void ); void check_log_size( void ); void dbgflush( void ); -bool dbghdrclass(int level, int cls, const char *location, const char *func); bool debug_get_output_is_stderr(void); bool debug_get_output_is_stdout(void); void debug_schedule_reopen_logs(void); -- 2.17.1