From 93c2c18a801768ddf5d124b303b7d3d1c5a76001 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 5 Dec 1999 22:36:02 +0000 Subject: [PATCH] (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. --- src/tail.c | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- 2.47.3