From: Peter Hutterer Date: Thu, 12 Jan 2023 23:23:52 +0000 (+1000) Subject: tools: fflush the output in debug-events after each set of events X-Git-Tag: 1.23.0~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0266428c9300a18cec44786d84d5502b89c1e6eb;p=platform%2Fupstream%2Flibinput.git 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 --- 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; }