linux: Handle device disconnection early when possible
authorChris Dickens <christopher.a.dickens@gmail.com>
Thu, 27 Jun 2013 16:14:15 +0000 (09:14 -0700)
committerHans de Goede <hdegoede@redhat.com>
Wed, 21 Aug 2013 13:58:00 +0000 (15:58 +0200)
commit6732582bb17662aa02a913008be899ef9ace5870
tree6c9534fdff1757f5e94135c4f876b6ecf953904c
parenta06eafdc528d5f3ea21a26c34ceaa13e09dfd4f3
linux: Handle device disconnection early when possible

If a device is open, the device's fd will trigger a POLLERR condition
once it is removed. Sometimes this can occur well before the udev
monitor sends the remove event. This can also be caught early if
the device is not currently open but an attempt to open it is made.

In both situations, this can be caught early and processed so that
the device does not continue to show up in the device list after it
has been disconnected but before the udev monitor processes the event.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
libusb/os/linux_netlink.c
libusb/os/linux_udev.c
libusb/os/linux_usbfs.c
libusb/os/linux_usbfs.h
libusb/version_nano.h