usb_bulk_read: may return 0 on timeout.
Pointed out by Jasper Lievisse Adriaanse <jasper@openbsd.org>.
This commit is contained in:
parent
a0ece48e4e
commit
7a0a30f626
2
olimex.c
2
olimex.c
|
@ -272,7 +272,7 @@ transport_t olimex_open(const char *devpath, const char *requested_serial)
|
||||||
/* Flush out lingering data */
|
/* Flush out lingering data */
|
||||||
while (usb_bulk_read(tr->handle, tr->in_ep,
|
while (usb_bulk_read(tr->handle, tr->in_ep,
|
||||||
buf, sizeof(buf),
|
buf, sizeof(buf),
|
||||||
100) >= 0);
|
100) > 0);
|
||||||
|
|
||||||
return (transport_t)tr;
|
return (transport_t)tr;
|
||||||
}
|
}
|
||||||
|
|
2
rf2500.c
2
rf2500.c
|
@ -231,7 +231,7 @@ transport_t rf2500_open(const char *devpath, const char *requested_serial)
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
while (usb_bulk_read(tr->handle, USB_FET_IN_EP,
|
while (usb_bulk_read(tr->handle, USB_FET_IN_EP,
|
||||||
buf, sizeof(buf),
|
buf, sizeof(buf),
|
||||||
100) >= 0);
|
100) > 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return (transport_t)tr;
|
return (transport_t)tr;
|
||||||
|
|
Loading…
Reference in New Issue