Feedback for portable libusb code

Hans Petter Selasky hps at selasky.org
Mon Jan 29 19:13:03 UTC 2018


On 01/29/18 19:44, Romain Tartière wrote:
> Hello!
> 
> FreeBSD's libusb allows userland programs to access USB devices in a way
> similar to GNU/Linux with it's libusb.
> 
> However, there are some differences between these implementations.  I
> recently diagnosed an issue in sigrok, provided a patch, but the
> maintainer is having some questions and I am not sure about the best way
> to address them.
> 
> If someone with more USB insight could give a look to this GitHub issue,
> that would be awesome !
> 
> Basically, the usb_get_port_path() calls libusb_open() before (and
> libusb_close() after) libusb_get_port_numbers() because this is required
> on FreeBSD:
> https://github.com/sigrokproject/libsigrok/blob/a9010323ddf4e479663e871386c05db05ea3522e/src/usb.c#L478-L491
> 
> However, calling libusb_open() twice fails…
> 
> The issue is here:
> https://github.com/sigrokproject/libsigrok/pull/6

Hi,

Does the attached patch for FreeBSD's libusb solve your issue?

--HPS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libusb.diff
Type: text/x-patch
Size: 1936 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-usb/attachments/20180129/db865c30/attachment.bin>


More information about the freebsd-usb mailing list