summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inotail.c4
1 files changed, 3 insertions, 1 deletions
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;