summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c2
-rw-r--r--source3/lib/debug.c36
2 files changed, 32 insertions, 6 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index f010dfebf4..d23bdb5796 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -3418,7 +3418,7 @@ static BOOL process(char *base_directory)
/* display a prompt */
DEBUG(0,("smb: %s> ", CNV_LANG(cur_dir)));
- fflush(dbf);
+ dbgflush( );
wait_keyboard(InBuffer);
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 4270150d15..24f508c0b4 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -383,6 +383,22 @@ va_dcl
return( 0 );
} /* Debug1 */
+
+/* ************************************************************************** **
+ * Print the buffer content via Debug1(), then reset the buffer.
+ *
+ * Input: none
+ * Output: none
+ *
+ * ************************************************************************** **
+ */
+static void bufr_print( void )
+ {
+ format_bufr[format_pos] = '\0';
+ (void)Debug1( "%s", format_bufr );
+ format_pos = 0;
+ } /* bufr_print */
+
/* ************************************************************************** **
* Format the debug message text.
*
@@ -420,11 +436,7 @@ static void format_debug_text( char *msg )
/* If a newline is encountered, print & restart. */
if( '\n' == msg[i] )
- {
- format_bufr[format_pos] = '\0';
- (void)Debug1( "%s", format_bufr );
- format_pos = 0;
- }
+ bufr_print();
}
/* Just to be safe... */
@@ -432,6 +444,20 @@ static void format_debug_text( char *msg )
} /* format_debug_text */
/* ************************************************************************** **
+ * Flush debug output, including the format buffer content.
+ *
+ * Input: none
+ * Output: none
+ *
+ * ************************************************************************** **
+ */
+void dbgflush( void )
+ {
+ bufr_print();
+ (void)fflush( dbf );
+ } /* dbgflush */
+
+/* ************************************************************************** **
* Print a Debug Header.
*
* Input: level - Debug level of the message (not the system-wide debug