diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2023-01-13 09:23:52 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2023-01-13 09:28:32 +1000 |
commit | 0266428c9300a18cec44786d84d5502b89c1e6eb (patch) | |
tree | cc1709c29589112f79885265b9873fdb607d3fda /tools/libinput-debug-events.c | |
parent | 29a49e968e67eb7bf6d63c9f93b06ee983772018 (diff) | |
download | libinput-0266428c9300a18cec44786d84d5502b89c1e6eb.tar.gz |
tools: fflush the output in debug-events after each set of events
Fixes e.g. the case where debug-events is used to get the initial device
list but no more. Since we never flush, the content is stuck in the
buffers and gets lost.
Easy way to reproduce: `libinput debug-events | cat`, then ctrl+c and see
nothing show up (before this patch, anyway).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/libinput-debug-events.c')
-rw-r--r-- | tools/libinput-debug-events.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/libinput-debug-events.c b/tools/libinput-debug-events.c index 9ad71b6a..9034e2cd 100644 --- a/tools/libinput-debug-events.c +++ b/tools/libinput-debug-events.c @@ -951,6 +951,9 @@ handle_and_print_events(struct libinput *li) libinput_event_destroy(ev); rc = 0; } + + fflush(stdout); + return rc; } |