summaryrefslogtreecommitdiffstats
path: root/libbb
diff options
context:
space:
mode:
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-02-15 18:10:02 (EST)
committer graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-02-15 18:10:02 (EST)
commitdbf9c6748a2c7eb32f7a61ea2b393d32ea334c8b (patch)
treed49d3341ab1ab291a8b1806528954ce079843a34 /libbb
parent195000335cbba83deeabbcd25ce9627cb3e650f6 (diff)
Flush stdout, stderr before forking. From Richard Purdie. Thanks!
Patch to remove "duplicate" bits of logs from opkg output, which massively simplifies do_rootfs logs. The reason is we get unflushed data passed to the children and duplicated. RP - 26/1/10 git-svn-id: http://opkg.googlecode.com/svn/trunk@522 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libbb')
-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);