From 3cc9bd9d21120a5b16091734db33cd84831c7f38 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 10 Feb 2011 08:50:41 +1000 Subject: When piping into a file, don't buffer. Turn off buffering when piping the output into a file to stop ppl sending me empty logs. Signed-off-by: Peter Hutterer --- evtest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/evtest.c b/evtest.c index a68b900..8671c07 100644 --- a/evtest.c +++ b/evtest.c @@ -637,6 +637,9 @@ int main (int argc, char **argv) free(filename); + if (!isatty(fileno(stdout))) + setbuf(stdout, NULL); + if (print_device_info(fd)) return 1; @@ -653,6 +656,5 @@ int main (int argc, char **argv) printf("***********************************************\n"); } - return print_events(fd); } -- cgit v1.2.3