On Fri, Aug 17, 2012 at 01:29:10PM +0300, Nikolai Kondrashov wrote:
> 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 <sp...@gm...>
> ---
> src/test.c | 2 ++
> src/test_xi2.c | 2 ++
> 2 files changed, 4 insertions(+)
>
> 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;
> --
> 1.7.10.4
looks good, thanks. Forwarded to xorg-devel, expect it to be pushed soon.
Cheers,
Peter
|