]> diplodocus.org Git - xorg-xinput/commitdiff
Increase interactiveness of test* output
authorNikolai Kondrashov <spbnick@gmail.com>
Fri, 17 Aug 2012 10:29:10 +0000 (13:29 +0300)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 20 Aug 2012 00:44:34 +0000 (10:44 +1000)
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 <spbnick@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/test.c
src/test_xi2.c

index 97305c5..0c95501 100644 (file)
@@ -98,6 +98,8 @@ print_events(Display  *dpy)
 {
     XEvent        Event;
 
+    setlinebuf(stdout);
+
     while(1) {
        XNextEvent(dpy, &Event);
 
index bcb4880..04e1004 100644 (file)
@@ -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;