[SSSD] [PATCH 4/4] Remove extra flushing from debug message output

Nikolai Kondrashov Nikolai.Kondrashov at redhat.com
Thu Oct 10 14:07:31 UTC 2013


Remove extra fflush(3) invocation when outputting debug messages.
---
 src/util/debug.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/util/debug.c b/src/util/debug.c
index c2e2571..9588083 100644
--- a/src/util/debug.c
+++ b/src/util/debug.c
@@ -104,10 +104,14 @@ int debug_convert_old_level(int old_level)
     return new_level;
 }
 
+static void debug_fflush(void)
+{
+    fflush(debug_file ? debug_file : stderr);
+}
+
 static void debug_vprintf(const char *format, va_list ap)
 {
     vfprintf(debug_file ? debug_file : stderr, format, ap);
-    fflush(debug_file ? debug_file : stderr);
 }
 
 static void debug_printf(const char *format, ...)
@@ -157,6 +161,7 @@ void debug_fn(const char *function, int level, const char *format, ...)
         va_start(ap, format);
         debug_vprintf(format, ap);
         va_end(ap);
+        debug_fflush();
     }
 }
 
-- 
1.8.4.rc3




More information about the sssd-devel mailing list