1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

debug: Simplify Debug1

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Christof Schmitt 2015-01-09 15:00:04 -07:00
parent c89a33a07a
commit d8ba76e997

View File

@ -1018,33 +1018,32 @@ void check_log_size( void )
This is called by dbghdr() and format_debug_text().
************************************************************************/
static int Debug1(const char *msg)
static void Debug1(const char *msg)
{
int old_errno = errno;
debug_count++;
if (state.logtype == DEBUG_CALLBACK) {
switch(state.logtype) {
case DEBUG_CALLBACK:
debug_callback_log(msg, current_msg_level);
goto done;
}
if ( state.logtype != DEBUG_FILE ) {
break;
case DEBUG_STDOUT:
case DEBUG_STDERR:
case DEBUG_DEFAULT_STDOUT:
case DEBUG_DEFAULT_STDERR:
if (state.fd > 0) {
write(state.fd, msg, strlen(msg));
}
goto done;
}
break;
case DEBUG_FILE:
debug_backends_log(msg, current_msg_level);
break;
};
debug_backends_log(msg, current_msg_level);
done:
errno = old_errno;
return( 0 );
}
/**************************************************************************
Print the buffer content via Debug1(), then reset the buffer.
Input: none