1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

log: flush stdout before print to stderr

Keep logging readable and fflush stdout before printing to stderr.
This commit is contained in:
Zdenek Kabelac 2015-06-19 16:24:32 +02:00
parent 3173442984
commit 00d028fd77

View File

@ -385,6 +385,8 @@ void print_log(int level, const char *file, int line, int dm_errno_or_class,
default:
/* Typically only log_warn goes to stdout */
stream = (use_stderr || (level != _LOG_WARN)) ? stderr : stdout;
if (stream == stderr)
fflush(stdout);
fprintf(stream, "%s%s%s%s", buf, log_command_name(),
_msg_prefix, indent_spaces);
vfprintf(stream, trformat, ap);