diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-10-11 20:44:19 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-10-11 20:44:19 +0200 |
commit | 2c4391e95002404fb2e1d09f97541c1ece1da46f (patch) | |
tree | bf903d374cfffd8bf868e1ac2ac351621b102f05 /source3/lib/debug.c | |
parent | a85f6634853a4cf825d70e07a789e96e1882f376 (diff) | |
download | samba-2c4391e95002404fb2e1d09f97541c1ece1da46f.tar.gz samba-2c4391e95002404fb2e1d09f97541c1ece1da46f.tar.xz samba-2c4391e95002404fb2e1d09f97541c1ece1da46f.zip |
Provide the same set of helper functions for DEBUG in Samba 3 and Samba
4, even though the macros are still different.
This makes it possible to use object code compiled with one DEBUG()
macro from the other sourceX directory.
Diffstat (limited to 'source3/lib/debug.c')
-rw-r--r-- | source3/lib/debug.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c index d91b55dd23b..be2707b5950 100644 --- a/source3/lib/debug.c +++ b/source3/lib/debug.c @@ -984,7 +984,7 @@ void dbgflush( void ) ****************************************************************************/ -bool dbghdr(int level, int cls, const char *file, const char *func, int line) +bool dbghdrclass(int level, int cls, const char *location, const char *func) { /* Ensure we don't lose any real errno value. */ int old_errno = errno; @@ -1046,10 +1046,10 @@ bool dbghdr(int level, int cls, const char *file, const char *func, int line) lp_debug_hires_timestamp()), level, header_str); } else { - (void)Debug1( "[%s, %2d%s] %s:%s(%d)\n", + (void)Debug1( "[%s, %2d%s] %s(%s)\n", current_timestring(debug_ctx(), lp_debug_hires_timestamp()), - level, header_str, file, func, line ); + level, header_str, location, func ); } } @@ -1057,6 +1057,12 @@ bool dbghdr(int level, int cls, const char *file, const char *func, int line) return( True ); } +bool dbghdr(int level, const char *location, const char *func) +{ + /* For compatibility with Samba 4, which doesn't have debug classes */ + return dbghdrclass(level, 0, location, func); +} + /*************************************************************************** Add text to the body of the "current" debug message via the format buffer. |