I've added a dbgflush() function to debug.c. Calling this will cause the
authorChristopher R. Hertel <crh@samba.org>
Wed, 12 Aug 1998 14:51:17 +0000 (14:51 +0000)
committerChristopher R. Hertel <crh@samba.org>
Wed, 12 Aug 1998 14:51:17 +0000 (14:51 +0000)
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)

source3/client/client.c
source3/lib/debug.c

index f010dfebf4ea9ac5c4888c1069ea37d862bfeeff..d23bdb579667846b41a4cd03344f2565ab1dd83d 100644 (file)
@@ -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);
   
index 4270150d15683982e7d02a8d03dcdecc5b63fed6..24f508c0b40fb7b24570eebdee2de6431d63face 100644 (file)
@@ -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,17 +436,27 @@ 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... */
   format_bufr[format_pos] = '\0';
   } /* 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.
  *