From 61fbbfe3d892e113901916a277d71a27f348e7be Mon Sep 17 00:00:00 2001 From: Kenneth Johansson Date: Mon, 18 Dec 2017 21:03:37 +0100 Subject: [PATCH] fatrace: we need to flush every line when using a pipe. /sbin/fatrace -c -t -f W | grep "/etc/" produced no output until internal printf buffer full and that is not so useful. --- fatrace/patches/002-fflush.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 fatrace/patches/002-fflush.patch diff --git a/fatrace/patches/002-fflush.patch b/fatrace/patches/002-fflush.patch new file mode 100644 index 000000000..5cf27c0c2 --- /dev/null +++ b/fatrace/patches/002-fflush.patch @@ -0,0 +1,12 @@ +diff --git a/fatrace.c b/fatrace.c +index b7d1560..6179272 100644 +--- a/fatrace.c ++++ b/fatrace.c +@@ -149,6 +149,7 @@ print_event(const struct fanotify_event_metadata *data, + printf ("%li.%06li ", event_time->tv_sec, event_time->tv_usec); + } + printf ("%s(%i): %s %s\n", procname, data->pid, mask2str (data->mask), pathname); ++ fflush(stdout); + } + + /**