summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2013-10-10 15:35:02 +0300
committerJakub Hrozek <jhrozek@redhat.com>2014-02-12 22:30:47 +0100
commit63ec0cbd668b251708fad23b60cf557163963dc4 (patch)
treef256622700ed2f4f56bb29a232d219d1b69402a3 /src/util
parentfb0332565892bc10998ca98b567d4dde2213844d (diff)
downloadsssd-63ec0cbd668b251708fad23b60cf557163963dc4.tar.gz
sssd-63ec0cbd668b251708fad23b60cf557163963dc4.tar.xz
sssd-63ec0cbd668b251708fad23b60cf557163963dc4.zip
Remove extra flushing from debug message output
Remove extra fflush(3) invocation when outputting debug messages. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/debug.c7
1 files changed, 6 insertions, 1 deletions
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)