summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-07-13 15:40:15 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-07-13 16:06:57 -0400
commit2a7bfe835317bb9f3ebcd20079b2bb800f4b9eaa (patch)
tree3b61ff73be02de3624fb922347b803323003bb95
parentebabf2ad6d19af5c674b624bafe619dedbc94403 (diff)
downloade2fsprogs-2a7bfe835317bb9f3ebcd20079b2bb800f4b9eaa.tar.gz
Flush stdio buffers before calling setbuf()
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>
-rw-r--r--debugfs/debugfs.c2
-rw-r--r--lib/ss/test_ss.c2
-rw-r--r--tests/progs/test_icount.c2
-rw-r--r--tests/progs/test_rel.c2
4 files changed, 8 insertions, 0 deletions
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 85facacb..7039340d 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -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)) {
diff --git a/lib/ss/test_ss.c b/lib/ss/test_ss.c
index 0b0bb587..36e899d3 100644
--- a/lib/ss/test_ss.c
+++ b/lib/ss/test_ss.c
@@ -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)) {
diff --git a/tests/progs/test_icount.c b/tests/progs/test_icount.c
index 026779fb..faffcf8a 100644
--- a/tests/progs/test_icount.c
+++ b/tests/progs/test_icount.c
@@ -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)) {
diff --git a/tests/progs/test_rel.c b/tests/progs/test_rel.c
index 351c662e..86a9b0da 100644
--- a/tests/progs/test_rel.c
+++ b/tests/progs/test_rel.c
@@ -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)) {