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 0266428c93)
This commit is contained in:
Peter Hutterer 2023-01-13 09:23:52 +10:00
parent 6420178b5f
commit d6099ab159

View file

@ -952,6 +952,9 @@ handle_and_print_events(struct libinput *li)
libinput_event_destroy(ev);
rc = 0;
}
fflush(stdout);
return rc;
}