evdev: don't resume a removed device
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 30 Jan 2014 06:33:24 +0000 (16:33 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 18 Sep 2014 01:31:23 +0000 (11:31 +1000)
commit8be1abf58ad855ba25f48db5a7196c85dda1ff25
tree887199140b043577bf7040cd586550d00751b35c
parent3e93d913bef339311976a927091674fb7f1f4987
evdev: don't resume a removed device

A device may disappear and a new device may re-appear with the same device
node while the original device is suspended. Prevent a device resume to open
the wrong device.

In a path context, a changing syspath is the only indicator we get of the
device changing.
In a udev context, if the device was removed and libinput_dispatch() was
called, we can short-cut the syspath comparison by setting it to NULL.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev.c
src/evdev.h
src/path.c
src/udev-seat.c