From: Jim Meyering Date: Sun, 5 Dec 1999 22:36:02 +0000 (+0000) Subject: (main): Flush stdout before switching to unbuffered mode X-Git-Tag: FILEUTILS-4_0l~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=93c2c18a801768ddf5d124b303b7d3d1c5a76001;p=thirdparty%2Fcoreutils.git (main): Flush stdout before switching to unbuffered mode and calling tail_forever. Required only on Solaris2.7 -- on other systems, using setvbuf to switch to unbufferd mode does the flush. --- diff --git a/src/tail.c b/src/tail.c index 7a2c32506f..a2a8979b1b 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1526,6 +1526,10 @@ main (int argc, char **argv) if (forever) { + /* This fflush appears to be required only on Solaris2.7. */ + if (fflush (stdout) < 0) + error (EXIT_FAILURE, errno, _("write error")); + SETVBUF (stdout, NULL, _IONBF, 0); tail_forever (F, n_files); }