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-16 14:52:29 +1000 |
commit | d6099ab159e485a9eda2ec8d108a51830c4ec42d (patch) | |
tree | ef54dd20a80a7f5c82e568250cc2c9492be124d6 | |
parent | 6420178b5fdb5f9c5f353556703ae151891297fd (diff) |
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>
(cherry picked from commit 0266428c9300a18cec44786d84d5502b89c1e6eb)
-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 8b8da6f1..b851cd67 100644 --- a/tools/libinput-debug-events.c +++ b/tools/libinput-debug-events.c @@ -952,6 +952,9 @@ handle_and_print_events(struct libinput *li) libinput_event_destroy(ev); rc = 0; } + + fflush(stdout); + return rc; } |