diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-02-10 08:50:41 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-02-10 09:34:05 +1000 |
commit | 3cc9bd9d21120a5b16091734db33cd84831c7f38 (patch) | |
tree | 7e2aa2e4edfb78ef99f5071e678ade8567ea4f0e | |
parent | ae6d48ceb70d0204c6ab981034c2ebc417da3c1a (diff) |
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 <peter.hutterer@who-t.net>
-rw-r--r-- | evtest.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); } |