mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-12-11 10:53:26 +08:00
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>
This commit is contained in:
parent
ebabf2ad6d
commit
2a7bfe8353
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user