[SSSD] [PATCH 4/4] Remove extra flushing from debug message output
Stephen Gallagher
sgallagh at redhat.com
Thu Oct 10 19:54:30 UTC 2013
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
> 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(); } }
>
>
Ack. Prior to this patch, we were calling fflush() twice for every
DEBUG message. This reduces it to a single call.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlJXBfYACgkQeiVVYja6o6OzaQCdFd32QSQ+7TIDrAJwfJNDUPOD
PcEAmQFg7ky0b6vHbEenVmoOJ7i8nPR9
=M3cR
-----END PGP SIGNATURE-----
More information about the sssd-devel
mailing list