From 86bad98403604f4738e8c252519755654f954eb0 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 24 Jun 2007 20:08:58 +0200 Subject: inotail.c: Flush stdout in write_header() To make sure the header is also printed when piping inotail output to pipes. --- inotail.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inotail.c b/inotail.c index 6a000f7..8fcf9fd 100644 --- a/inotail.c +++ b/inotail.c @@ -119,8 +119,10 @@ static void write_header(char *filename) static unsigned short first_file = 1; static char *last = NULL; - if (last != filename) + if (last != filename) { fprintf(stdout, "%s==> %s <==\n", (first_file ? "" : "\n"), pretty_name(filename)); + fflush(stdout); /* Make sure the header is printed before the content */ + } first_file = 0; last = filename; -- cgit v1.2.3-54-g00ecf