Whamcloud - gitweb
Flush stdio buffers before calling setbuf()
authorTheodore Ts'o <tytso@mit.edu>
Sun, 13 Jul 2008 19:40:15 +0000 (15:40 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 13 Jul 2008 20:06:57 +0000 (16:06 -0400)
On Solaris setbuf() will discard any pending output to the stream, so
make we call fflush() before calling setbuf().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debugfs/debugfs.c
lib/ss/test_ss.c
tests/progs/test_icount.c
tests/progs/test_rel.c

index 85facac..7039340 100644 (file)
@@ -1822,6 +1822,8 @@ static int source_file(const char *cmd_file, int sci_idx)
                        exit(1);
                }
        }
+       fflush(stdout);
+       fflush(stderr);
        setbuf(stdout, NULL);
        setbuf(stderr, NULL);
        while (!feof(f)) {
index 0b0bb58..36e899d 100644 (file)
@@ -49,6 +49,8 @@ static int source_file(const char *cmd_file, int sci_idx)
                        exit(1);
                }
        }
+       fflush(stdout);
+       fflush(stderr);
        setbuf(stdout, NULL);
        setbuf(stderr, NULL);
        while (!feof(f)) {
index 026779f..faffcf8 100644 (file)
@@ -261,6 +261,8 @@ static int source_file(const char *cmd_file, int sci_idx)
                        exit(1);
                }
        }
+       fflush(stdout);
+       fflush(stderr);
        setbuf(stdout, NULL);
        setbuf(stderr, NULL);
        while (!feof(f)) {
index 351c662..86a9b0d 100644 (file)
@@ -677,6 +677,8 @@ static int source_file(const char *cmd_file, int sci_idx)
                        exit(1);
                }
        }
+       fflush(stdout);
+       fflush(stderr);
        setbuf(stdout, NULL);
        setbuf(stderr, NULL);
        while (!feof(f)) {