diff options
author | Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> | 2013-10-10 15:35:02 +0300 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-05-02 10:58:10 +0200 |
commit | 7f3b9e09ff4664ef86b44ef0f89f40bbcaecfbce (patch) | |
tree | f4a8b3c73c7a2e8bfb74e51e338ac321f515b45e /src | |
parent | dab43bc463a25109f6d86d64722f5e9c60d465e5 (diff) | |
download | sssd-7f3b9e09ff4664ef86b44ef0f89f40bbcaecfbce.tar.gz sssd-7f3b9e09ff4664ef86b44ef0f89f40bbcaecfbce.tar.xz sssd-7f3b9e09ff4664ef86b44ef0f89f40bbcaecfbce.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>
(cherry picked from commit 63ec0cbd668b251708fad23b60cf557163963dc4)
Diffstat (limited to 'src')
-rw-r--r-- | src/util/debug.c | 7 |
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) |