diff options
Diffstat (limited to 'src/assuan-logging.c')
-rw-r--r-- | src/assuan-logging.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/assuan-logging.c b/src/assuan-logging.c index fd40dcc..bd28eb1 100644 --- a/src/assuan-logging.c +++ b/src/assuan-logging.c @@ -112,6 +112,11 @@ _assuan_log_printf (const char *format, ...) va_start (arg_ptr, format); vfprintf (fp, format, arg_ptr ); va_end (arg_ptr); + /* If the log stream is a file, the output would be buffered. This + is bad for debugging, thus we flush the stream if FORMAT ends + with a LF. */ + if (format && *format && format[strlen(format)-1] == '\n') + fflush (fp); errno = save_errno; } |