[PATCH libevdev 1/2] uinput: check errno against the positive value

Peter Hutterer peter.hutterer at who-t.net
Mon Aug 11 23:00:31 PDT 2014


We use the negative errno internally, but the proper errno is always positive.

Fixes device creation failures on kernels that don't support UI_SET_PROPBIT.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 libevdev/libevdev-uinput.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libevdev/libevdev-uinput.c b/libevdev/libevdev-uinput.c
index e8419e6..4446b45 100644
--- a/libevdev/libevdev-uinput.c
+++ b/libevdev/libevdev-uinput.c
@@ -147,7 +147,7 @@ set_props(const struct libevdev *dev, int fd, struct uinput_user_dev *uidev)
 			 * ioctl is called on an already created device. The
 			 * last two can't happen here.
 			 */
-			if (errno == -EINVAL)
+			if (errno == EINVAL)
 				rc = 0;
 			break;
 		}
-- 
1.9.3



More information about the Input-tools mailing list