summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libbb/gz_open.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbb/gz_open.c b/libbb/gz_open.c
index 7c7c722..40f741f 100644
--- a/libbb/gz_open.c
+++ b/libbb/gz_open.c
@@ -38,6 +38,12 @@ gz_open(FILE *compressed_file, int *pid)
perror_msg("pipe");
return(NULL);
}
+
+ /* If we don't flush, we end up with two copies of anything pending,
+ one from the parent, one from the child */
+ fflush(stdout);
+ fflush(stderr);
+
if ((*pid = fork()) == -1) {
perror_msg("fork");
return(NULL);