[PATCH libevdev 2/3] tools: pass -rc to strerror, not rc

Peter Hutterer peter.hutterer at who-t.net
Thu Aug 21 19:56:26 PDT 2014


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));
 
 	rc = 0;
 out:
-- 
1.9.3



More information about the Input-tools mailing list