diff options
author | Andreas Klemm <andreas@FreeBSD.org> | 2003-11-25 19:35:43 +0000 |
---|---|---|
committer | Andreas Klemm <andreas@FreeBSD.org> | 2003-11-25 19:35:43 +0000 |
commit | 00dcb052a3b7de0a0af2b67b988f91b15ced50e3 (patch) | |
tree | e3e8892fa818faea284e44530238b6215aa16334 /devel/libusb | |
parent | d1868e9f768136f3dfdea75ea43233568296b292 (diff) | |
download | ports-00dcb052a3b7de0a0af2b67b988f91b15ced50e3.tar.gz ports-00dcb052a3b7de0a0af2b67b988f91b15ced50e3.zip |
Notes
Diffstat (limited to 'devel/libusb')
-rw-r--r-- | devel/libusb/Makefile | 1 | ||||
-rw-r--r-- | devel/libusb/files/patch-bsd.c | 62 |
2 files changed, 63 insertions, 0 deletions
diff --git a/devel/libusb/Makefile b/devel/libusb/Makefile index eb38a81e66a0..3630bc2a620b 100644 --- a/devel/libusb/Makefile +++ b/devel/libusb/Makefile @@ -7,6 +7,7 @@ PORTNAME= libusb PORTVERSION= 0.1.7 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/devel/libusb/files/patch-bsd.c b/devel/libusb/files/patch-bsd.c new file mode 100644 index 000000000000..7f188bf7feb0 --- /dev/null +++ b/devel/libusb/files/patch-bsd.c @@ -0,0 +1,62 @@ +--- bsd.c.orig Mon Nov 11 19:04:16 2002 ++++ bsd.c Sun Nov 23 15:51:49 2003 +@@ -276,7 +276,7 @@ + int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) + { +- int fd, ret, sent = 0; ++ int fd, ret; + + /* Ensure the endpoint address is correct */ + ep &= ~USB_ENDPOINT_IN; +@@ -298,8 +298,7 @@ + USB_ERROR_STR(ret, "error setting timeout: %s", + strerror(errno)); + +- do { +- ret = write(fd, bytes+sent, size-sent); ++ ret = write(fd, bytes, size); + if (ret < 0) + #if __FreeBSD__ + USB_ERROR_STR(ret, "error writing to bulk endpoint %s.%d: %s", +@@ -309,16 +308,13 @@ + dev->device->filename, UE_GET_ADDR(ep), strerror(errno)); + #endif + +- sent += ret; +- } while(ret > 0 && sent < size); +- +- return sent; ++ return ret; + } + + int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) + { +- int fd, ret, retrieved = 0, one = 1; ++ int fd, ret, one = 1; + + /* Ensure the endpoint address is correct */ + ep |= USB_ENDPOINT_IN; +@@ -345,8 +341,7 @@ + USB_ERROR_STR(ret, "error setting short xfer: %s", + strerror(errno)); + +- do { +- ret = read(fd, bytes+retrieved, size-retrieved); ++ ret = read(fd, bytes, size); + if (ret < 0) + #if __FreeBSD__ + USB_ERROR_STR(ret, "error reading from bulk endpoint %s.%d: %s", +@@ -355,10 +350,8 @@ + USB_ERROR_STR(ret, "error reading from bulk endpoint %s.%02d: %s", + dev->device->filename, UE_GET_ADDR(ep), strerror(errno)); + #endif +- retrieved += ret; +- } while (ret > 0 && retrieved < size); + +- return retrieved; ++ return ret; + } + + int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, |