uinput: check errno against the positive value

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@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
Peter Hutterer 2014-08-12 15:38:47 +10:00
parent a5f150ef57
commit 09529a6a65

View file

@ -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 * ioctl is called on an already created device. The
* last two can't happen here. * last two can't happen here.
*/ */
if (errno == -EINVAL) if (errno == EINVAL)
rc = 0; rc = 0;
break; break;
} }