summaryrefslogtreecommitdiff
path: root/source3/lib/debug.c
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@samba.org>1998-08-12 14:51:17 +0000
committerChristopher R. Hertel <crh@samba.org>1998-08-12 14:51:17 +0000
commit08feb74221427423b44f3ea5cae182f7e392f0f5 (patch)
tree930a4f53ce36d7fca4fcf36446dc5260741a0285 /source3/lib/debug.c
parentfcb5437da6a32b641260502d371494df614949d0 (diff)
downloadsamba-08feb74221427423b44f3ea5cae182f7e392f0f5.tar.gz
samba-08feb74221427423b44f3ea5cae182f7e392f0f5.tar.bz2
samba-08feb74221427423b44f3ea5cae182f7e392f0f5.zip
I've added a dbgflush() function to debug.c. Calling this will cause the
debug format buffer to be written out (and reset). fflush() is also called to force the issue. I replaced the call to fflush() in client.c with a call to dbgflush(), which seems to have fixed the problem that Andrew was working on (i.e., that the prompt was not displayed when using smbclient). Chris -)----- (This used to be commit a97460869fe1448be5132fdab586d30872d21a69)
Diffstat (limited to 'source3/lib/debug.c')
-rw-r--r--source3/lib/debug.c36
1 files changed, 31 insertions, 5 deletions
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