summaryrefslogtreecommitdiff
path: root/src/print.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-04-26 09:34:32 +0300
committerTimo Teräs <timo.teras@iki.fi>2017-04-26 09:34:32 +0300
commit027df02dc28f3a73823282038fe1ab1d3ae3e65f (patch)
treeb597da595835825db16a51632c699f1950f9fa54 /src/print.c
parentf3a4272a02f808d9f0eb2559c4b327fa88756faf (diff)
downloadapk-tools-027df02dc28f3a73823282038fe1ab1d3ae3e65f.tar.gz
apk-tools-027df02dc28f3a73823282038fe1ab1d3ae3e65f.tar.bz2
apk-tools-027df02dc28f3a73823282038fe1ab1d3ae3e65f.tar.xz
apk-tools-027df02dc28f3a73823282038fe1ab1d3ae3e65f.zip
print: handle mixing stdout and stderr printing
Fixes regression from commit 5ba27c90 which caused stdio buffering issues now that output is split to stderr/stdout. See also commit 51737872 for some of the history. Fixes #7107
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/print.c b/src/print.c
index c4e1c2f..ee89c43 100644
--- a/src/print.c
+++ b/src/print.c
@@ -159,6 +159,8 @@ const char *apk_error_str(int error)
static void log_internal(FILE *dest, const char *prefix, const char *format, va_list va)
{
+ if (dest != stdout)
+ fflush(stdout);
if (prefix != NULL)
fprintf(dest, "%s", prefix);
vfprintf(dest, format, va);