libevdev_uinput_destroy: don't close non-open FD
authorOwen W. Taylor <otaylor@fishsoup.net>
Mon, 19 Jan 2015 21:45:49 +0000 (16:45 -0500)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 20 Jan 2015 22:48:50 +0000 (08:48 +1000)
commit867a237c5597ab14daff50253d5d73bcc8a44ef6
tree2ea26e76874ee9189da5535dd0b06d7b95b6e4d8
parentf4cc76d96f411b1ab1a2809379839f5573236f79
libevdev_uinput_destroy: don't close non-open FD

The returned errno from libevdev_input_create_from_device was returned
incorrectly because libevdev_uinput_destroy() would try to close the
unset value of ->fd, overwriting errno.

That was fixed in debe9b030c8069cdf78307888ef3b65830b25122, this patch avoids
the ioctl/close calls if the fd isn't set.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
libevdev/libevdev-uinput.c