evdev: release devices on read() error
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 15 Oct 2013 12:29:56 +0000 (14:29 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 15 Oct 2013 16:12:30 +0000 (09:12 -0700)
commite05a0cd92cbdad70791bce4e39f87d66f2acdbcd
treede8bd57718281bb57a1dcbf94d803215fac44509
parentc133fc4836173c37a32cc073c2eb89859ed31f1d
evdev: release devices on read() error

If read() fails without EAGAIN/EINTR, the device is very likely dead.
However, we must not remove the device as it might be muted/revoked. So we
simply remove the event-source to avoid polling the device and simply wait
for the udev-remove signal now.

Note that we cannot call evdev_device_destroy() as the caller created the
FD and might need custom code to close it (like weston_launcher_close()).
src/evdev.c