ports/153810: [PATCH] Fix usb_interrupt_read() in libusb for fbsd 7

Simon Walton simonw at matteworld.com
Sun Jan 9 08:50:03 UTC 2011


>Number:         153810
>Category:       ports
>Synopsis:       [PATCH] Fix usb_interrupt_read() in libusb for fbsd 7
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 09 08:50:03 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Simon Walton
>Release:        7.2
>Organization:
Matte World Digital
>Environment:
FreeBSD stepney 7.2-RELEASE FreeBSD 7.2-RELEASE #4: Sun Aug 22 22:37:09 PDT 2010     simonw at stepney:/usr/src/sys/i386/compile/STEPNEY  i386

>Description:
Current libusb 0.1 in ports opens the interrupt endpoint with the NONBLOCK
flag in usb_interrupt_read(). In freebsd 7.2 reads will always fail with
EAGAIN (aka EWOULDBLOCK).
>How-To-Repeat:
An app that attempts to read a USB device's interrupt channel will
always fail. In my case the app was Argyll CMS controlling a USB
monitor probe.
>Fix:
Apply patch. Note that this just reverts an existing patch to libusb. The
original patch was indicated for fixing communication with a UPS. It
may have been necessary when timeouts for interrupt reads were broken.

Patch attached with submission follows:

--- libusb/files/patch-bsd.c.orig	2011-01-09 00:19:17.000000000 -0800
+++ libusb/files/patch-bsd.c	2011-01-09 00:20:29.000000000 -0800
@@ -1,14 +1,5 @@
 --- bsd.c.orig	2006-03-04 03:52:46.000000000 +0100
 +++ bsd.c	2008-11-03 00:08:15.000000000 +0100
-@@ -408,7 +408,7 @@
-   /* Ensure the endpoint address is correct */
-   ep |= USB_ENDPOINT_IN;
- 
--  fd = ensure_ep_open(dev, ep, O_RDONLY);
-+  fd = ensure_ep_open(dev, ep, O_RDONLY | O_NONBLOCK);
-   if (fd < 0) {
-     if (usb_debug >= 2) {
- #ifdef __FreeBSD_kernel__
 @@ -477,7 +477,7 @@
      USB_ERROR_STR(-errno, "error sending control message: %s",
                    strerror(errno));


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list