uinput: preserve the errno before cleaning up

libevdev_uinput_destroy() may/will botch the errno, make sure we save it
before use.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2014-08-12 15:41:45 +10:00
parent 09529a6a65
commit debe9b030c

View file

@ -344,8 +344,9 @@ libevdev_uinput_create_from_device(const struct libevdev *dev, int fd, struct li
return 0;
error:
rc = -errno;
libevdev_uinput_destroy(new_device);
return -errno;
return rc;
}
LIBEVDEV_EXPORT void