From 63ec0cbd668b251708fad23b60cf557163963dc4 Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Thu, 10 Oct 2013 15:35:02 +0300 Subject: Remove extra flushing from debug message output Remove extra fflush(3) invocation when outputting debug messages. Reviewed-by: Jakub Hrozek Reviewed-by: Stephen Gallagher Reviewed-by: Simo Sorce --- src/util/debug.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/debug.c b/src/util/debug.c index 91a030f2c..a42623f1a 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, ...) @@ -155,6 +159,7 @@ void debug_fn(const char *function, int newlevel, const char *format, ...) va_start(ap, format); debug_vprintf(format, ap); va_end(ap); + debug_fflush(); } int debug_get_level(int old_level) -- cgit