From: Jim Meyering Date: Fri, 12 Mar 1999 15:12:55 +0000 (+0000) Subject: (dump_remainder): Don't fflush stdout here. X-Git-Tag: FILEUTILS-4_0e~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0aa18bb339f7d9e6011e099e169269b4a05d955;p=thirdparty%2Fcoreutils.git (dump_remainder): Don't fflush stdout here. (main) [if forever]: Make stdout unbuffered, instead. --- diff --git a/src/tail.c b/src/tail.c index 7be926e46b..11e78f2654 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, "-");