make usb_interrupt_read blocking again. O_NOBLOCK broke communication with my Garmin device, used via qlandkarte(gt).

"please just commit it" ajacoutot@, "I say make it blocking" jakemsr@
This commit is contained in:
sebastia 2011-01-17 18:03:49 +00:00
parent 1a2aea7a8d
commit d2e68e9288
2 changed files with 6 additions and 12 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.20 2011/01/17 03:55:47 jakemsr Exp $
# $OpenBSD: Makefile,v 1.21 2011/01/17 18:03:49 sebastia Exp $
COMMENT= USB access library
DISTNAME= libusb-0.1.12
REVISION= 2
REVISION = 3
SHARED_LIBS= usb 9.0 \
usbpp 10.0
MODGNU_SHARED_LIBS= usb '-export-dynamic' \

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-bsd_c,v 1.10 2011/01/17 03:55:47 jakemsr Exp $
$OpenBSD: patch-bsd_c,v 1.11 2011/01/17 18:03:49 sebastia Exp $
usb_os_find_busses(): these ioctls only need read access. do not
force read-write access to /dev/usb* to use libusb.
@ -8,8 +8,8 @@ usb_os_find_devices(): ugen(4) aren't necessarily the first driver
interfaces.
--- bsd.c.orig Sat Jan 15 17:21:11 2011
+++ bsd.c Sat Jan 15 17:19:33 2011
--- bsd.c.orig Sat Mar 4 03:52:46 2006
+++ bsd.c Mon Jan 17 08:24:49 2011
@@ -361,7 +361,7 @@ int usb_bulk_read(usb_dev_handle *dev, int ep, char *b
int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size,
int timeout)
@ -29,7 +29,7 @@ usb_os_find_devices(): ugen(4) aren't necessarily the first driver
if (ret < 0)
#ifdef __FreeBSD_kernel__
USB_ERROR_STR(-errno, "error writing to interrupt endpoint %s.%d: %s",
@@ -394,21 +393,18 @@ int usb_interrupt_write(usb_dev_handle *dev, int ep, c
@@ -394,16 +393,13 @@ int usb_interrupt_write(usb_dev_handle *dev, int ep, c
dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
#endif
@ -48,12 +48,6 @@ usb_os_find_devices(): ugen(4) aren't necessarily the first driver
/* 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__
@@ -428,8 +424,7 @@ int usb_interrupt_read(usb_dev_handle *dev, int ep, ch
if (ret < 0)
USB_ERROR_STR(-errno, "error setting short xfer: %s", strerror(errno));