[PATCH evemu 1/3] evemu-record: move describe_device into each mode

Benjamin Tissoires benjamin.tissoires at gmail.com
Mon Feb 29 09:24:32 UTC 2016


On Fri, Feb 26, 2016 at 3:52 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> This doesn't make sense just yet, it's prep work for an upcoming patch to call
> describe_device multiple times in the evemu-record case.
>

Indeed, it doesn't make sense, because you forgot to remove the common
"if (describe_device(output, fd)) {" chunk above. If we bisect here,
there will be 2 descriptions for each recording/describing.

Cheers,
Benjamin

> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  tools/evemu-record.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/tools/evemu-record.c b/tools/evemu-record.c
> index 1a81767..bedb659 100644
> --- a/tools/evemu-record.c
> +++ b/tools/evemu-record.c
> @@ -164,11 +164,21 @@ int main(int argc, char *argv[])
>                 if (!test_grab_device(fd))
>                         goto out;
>
> +               if (describe_device(output, fd)) {
> +                       fprintf(stderr, "error: could not describe device\n");
> +                       goto out;
> +               }
> +
>                 fprintf(output,  "################################\n");
>                 fprintf(output,  "#      Waiting for events      #\n");
>                 fprintf(output,  "################################\n");
>                 if (evemu_record(output, fd, INFINITE))
>                         fprintf(stderr, "error: could not record device\n");
> +       } else if (mode == EVEMU_DESCRIBE) {
> +               if (describe_device(output, fd)) {
> +                       fprintf(stderr, "error: could not describe device\n");
> +                       goto out;
> +               }
>         }
>
>         rc = 0;
> --
> 2.5.0
>
> _______________________________________________
> Input-tools mailing list
> Input-tools at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/input-tools


More information about the Input-tools mailing list