From: Nikolai Kondrashov Date: Fri, 17 Aug 2012 10:29:10 +0000 (+0300) Subject: Increase interactiveness of test* output X-Git-Url: https://diplodocus.org/git/xorg-xinput/commitdiff_plain/bcfa9123b41da8048450ed27aaeffff17b8eee99 Increase interactiveness of test* output Force line buffering for test and test_xi2 to increase interactiveness and avoid losing data with non-terminal stdout. This fixes capturing xinput test* output into a file. Signed-off-by: Nikolai Kondrashov Signed-off-by: Peter Hutterer --- diff --git a/src/test.c b/src/test.c index 97305c5..0c95501 100644 --- a/src/test.c +++ b/src/test.c @@ -98,6 +98,8 @@ print_events(Display *dpy) { XEvent Event; + setlinebuf(stdout); + while(1) { XNextEvent(dpy, &Event); diff --git a/src/test_xi2.c b/src/test_xi2.c index bcb4880..04e1004 100644 --- a/src/test_xi2.c +++ b/src/test_xi2.c @@ -326,6 +326,8 @@ test_xi2(Display *display, int deviceid = -1; int rc; + setlinebuf(stdout); + rc = list(display, argc, argv, name, desc); if (rc != EXIT_SUCCESS) return rc;