[Nut-upsuser] RE: Nut-upsuser Digest, Vol 11, Issue 3

Arnaud Quette aquette.dev at gmail.com
Tue May 9 07:31:45 UTC 2006

Hi Nevil,

many thanks for your feedback.

2006/5/8, Nevil Thatcher <NevilTh at nat.com.au>:
> ...
> 3). I found another problem with libusb on netBSD in that the
> Function usb_interrupt_read() calls read() which blocks on read from usb
> until buffer is full. In my case this was seemingly infinite. A timeout is
> passed to the function but netBSD does not seem to respect this.
> I have been meaning to lodge a bug-report but haven't as yet.
> To fix (hack) I changed bsd.c in libusb as follows:
> Change
> Fd = ensure_ep_open(dev, ep, 0, O_RDONLY)
> To
> Fd = ensure_ep_open(dev, ep, 0, O_RDONLY | O_NONBLOCK)
> This just tells the read to return immediately if no data from usb rather
> than block. OS buffers device anyway.

have you also forwarded this to the libusb maintainers?

Linux / Unix Expert - MGE UPS SYSTEMS - R&D Dpt
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
OpenSource Developer - http://arnaud.quette.free.fr/

More information about the Nut-upsuser mailing list