[PATCH libevdev 2/3] tools: pass -rc to strerror, not rc
David Herrmann
dh.herrmann at gmail.com
Fri Aug 22 07:58:54 PDT 2014
Hi
On Fri, Aug 22, 2014 at 4:56 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> rc is a negative errno
>
> Found by Coverity.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> tools/libevdev-events.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/libevdev-events.c b/tools/libevdev-events.c
> index 0711c78..3ce23f1 100644
> --- a/tools/libevdev-events.c
> +++ b/tools/libevdev-events.c
> @@ -185,7 +185,7 @@ main(int argc, char **argv)
> } while (rc == LIBEVDEV_READ_STATUS_SYNC || rc == LIBEVDEV_READ_STATUS_SUCCESS || rc == -EAGAIN);
>
> if (rc != LIBEVDEV_READ_STATUS_SUCCESS && rc != -EAGAIN)
> - fprintf(stderr, "Failed to handle events: %s\n", strerror(rc));
> + fprintf(stderr, "Failed to handle events: %s\n", strerror(-rc));
Stupid strerror() should just use abs() internally... anyway:
Reviewed-by: David Herrmann <dh.herrmann at gmail.com>
Thanks
David
> rc = 0;
> out:
> --
> 1.9.3
>
> _______________________________________________
> Input-tools mailing list
> Input-tools at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/input-tools
More information about the Input-tools
mailing list