From d6099ab159e485a9eda2ec8d108a51830c4ec42d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 13 Jan 2023 09:23:52 +1000 Subject: 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 (cherry picked from commit 0266428c9300a18cec44786d84d5502b89c1e6eb) --- tools/libinput-debug-events.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- cgit v1.2.1