summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-12-05 22:36:02 +0000
committerJim Meyering <jim@meyering.net>1999-12-05 22:36:02 +0000
commit93c2c18a801768ddf5d124b303b7d3d1c5a76001 (patch)
treef170985de3846fa522d6ede3c73e6c0f13175158 /src
parentdd002c22fd3abc847b5e79d5fca4cf3ee89b0f84 (diff)
downloadcoreutils-93c2c18a801768ddf5d124b303b7d3d1c5a76001.tar.xz
(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.
Diffstat (limited to 'src')
-rw-r--r--src/tail.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tail.c b/src/tail.c
index 7a2c32506..a2a8979b1 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);
}