summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-06-20 11:51:38 +0200
committerHans de Goede <hdegoede@redhat.com>2013-06-20 11:51:38 +0200
commitb0f7e06bac88dc97b2143f46af7ea0f2d32da467 (patch)
tree44b3317e4ff8bee5b2603cabc1f99c134700e374
parent12b18c3b633b0db4dbfeb15a9004dfc64486a5c5 (diff)
downloadlibusb-b0f7e06bac88dc97b2143f46af7ea0f2d32da467.tar.gz
Linux: Fix get_kernel_driver_active() when another app has claimed the interface
When another app has claimed the interface, IOCTL_USBFS_GETDRIVER will succeed and report a driver of "usbfs" being attached. Since this is not a regular kernel-driver (and detach_kernel_driver does not detach it), get_kernel_driver_active() should return 0 in this case. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--libusb/os/linux_usbfs.c2
-rw-r--r--libusb/version_nano.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
index 3d21a27..09288af 100644
--- a/libusb/os/linux_usbfs.c
+++ b/libusb/os/linux_usbfs.c
@@ -1469,7 +1469,7 @@ static int op_kernel_driver_active(struct libusb_device_handle *handle,
return LIBUSB_ERROR_OTHER;
}
- return 1;
+ return (strcmp(getdrv.driver, "usbfs") == 0) ? 0 : 1;
}
static int op_detach_kernel_driver(struct libusb_device_handle *handle,
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index be03325..a1ec522 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10748
+#define LIBUSB_NANO 10749