svn commit: r226307 - stable/9/lib/libusb
Hans Petter Selasky
hselasky at FreeBSD.org
Wed Oct 12 15:43:56 UTC 2011
Author: hselasky
Date: Wed Oct 12 15:43:56 2011
New Revision: 226307
URL: http://svn.freebsd.org/changeset/base/226307
Log:
MFC r226220
Fix libusb compliance.
Approved by: re (kib)
Modified:
stable/9/lib/libusb/libusb.3
stable/9/lib/libusb/libusb10.c
stable/9/lib/libusb/libusb20.3
Directory Properties:
stable/9/lib/libusb/ (props changed)
Modified: stable/9/lib/libusb/libusb.3
==============================================================================
--- stable/9/lib/libusb/libusb.3 Wed Oct 12 15:43:22 2011 (r226306)
+++ stable/9/lib/libusb/libusb.3 Wed Oct 12 15:43:56 2011 (r226307)
@@ -223,8 +223,8 @@ code on failure.
.Ft int
.Fn libusb_kernel_driver_active "libusb_device_handle *devh" "int interface"
Determine if a driver is active on a interface.
-Returns 0 if no kernel driver
-is active, 1 if a kernel driver is active, LIBUSB_ERROR_NO_DEVICE
+Returns 0 if no kernel driver is active
+and 1 if a kernel driver is active, LIBUSB_ERROR_NO_DEVICE
if the device has been disconnected and a LIBUSB_ERROR code on failure.
.Pp
.Ft int
Modified: stable/9/lib/libusb/libusb10.c
==============================================================================
--- stable/9/lib/libusb/libusb10.c Wed Oct 12 15:43:22 2011 (r226306)
+++ stable/9/lib/libusb/libusb10.c Wed Oct 12 15:43:56 2011 (r226307)
@@ -216,7 +216,6 @@ libusb_get_device_list(libusb_context *c
libusb20_be_free(usb_backend);
return (LIBUSB_ERROR_NO_MEM);
}
-
/* get device into libUSB v1.0 list */
libusb20_be_dequeue_device(usb_backend, pdev);
@@ -718,8 +717,10 @@ libusb_kernel_driver_active(struct libus
if (pdev == NULL)
return (LIBUSB_ERROR_INVALID_PARAM);
- return (libusb20_dev_kernel_driver_active(
- pdev, interface));
+ if (libusb20_dev_kernel_driver_active(pdev, interface))
+ return (0); /* no kernel driver is active */
+ else
+ return (1); /* kernel driver is active */
}
int
Modified: stable/9/lib/libusb/libusb20.3
==============================================================================
--- stable/9/lib/libusb/libusb20.3 Wed Oct 12 15:43:22 2011 (r226306)
+++ stable/9/lib/libusb/libusb20.3 Wed Oct 12 15:43:56 2011 (r226307)
@@ -614,10 +614,9 @@ The file descriptor can be used for poll
.Pp
.
.Fn libusb20_dev_kernel_driver_active
-returns a non-zero value if a kernel driver is active on
-the given USB interface.
+returns zero if a kernel driver is active on the given USB interface.
.
-Else zero is returned.
+Else a LIBUSB20_ERROR value is returned.
.
.Pp
.
More information about the svn-src-stable-9
mailing list