diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-12 15:12:55 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-12 15:12:55 +0000 |
commit | e0aa18bb339f7d9e6011e099e169269b4a05d955 (patch) | |
tree | 975365ce93cb0ceec21fd9dd5b9c46ffdcf883ed | |
parent | ac6d2b033e09df0ca573b78554cf0c0e8927c7a5 (diff) | |
download | coreutils-e0aa18bb339f7d9e6011e099e169269b4a05d955.tar.xz |
(dump_remainder): Don't fflush stdout here.
(main) [if forever]: Make stdout unbuffered, instead.
-rw-r--r-- | src/tail.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tail.c b/src/tail.c index 7be926e46..11e78f265 100644 --- a/src/tail.c +++ b/src/tail.c @@ -615,9 +615,6 @@ dump_remainder (const char *pretty_filename, int fd) if (bytes_read == -1) error (EXIT_FAILURE, errno, "%s", pretty_filename); - if (forever) - fflush (stdout); - return total; } @@ -1394,7 +1391,10 @@ main (int argc, char **argv) exit_status |= tail_file (&F[i], n_units); if (forever) - tail_forever (F, n_files); + { + SETVBUF (stdout, NULL, _IONBF, 0); + tail_forever (F, n_files); + } if (have_read_stdin && close (0) < 0) error (EXIT_FAILURE, errno, "-"); |