summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2015-10-25 10:18:34 +0000
committerwiz <wiz@pkgsrc.org>2015-10-25 10:18:34 +0000
commitd6d66dfb0dbe1974d1e8109f758a478fe83be74c (patch)
tree843507aa1a37de3a43cd3bd3f7b64b655aca8bd4
parentff9809ae6a08642a3ff8a492998c7ab8e48c5cc9 (diff)
downloadpkgsrc-d6d66dfb0dbe1974d1e8109f758a478fe83be74c.tar.gz
Fix a long-standing bug in short reads.
Reported by and patch from Dave Tyson in PR 50365. While here, fix return value for partial reads with errors. Bump PKGREVISION.
-rw-r--r--devel/libusb/Makefile6
-rw-r--r--devel/libusb/distinfo4
-rw-r--r--devel/libusb/patches/patch-ad20
3 files changed, 16 insertions, 14 deletions
diff --git a/devel/libusb/Makefile b/devel/libusb/Makefile
index 38b0713fa7c..7ab57e62f63 100644
--- a/devel/libusb/Makefile
+++ b/devel/libusb/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.36 2015/01/04 05:09:51 dholland Exp $
+# $NetBSD: Makefile,v 1.37 2015/10/25 10:18:34 wiz Exp $
DISTNAME= libusb-0.1.12
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=libusb/}
@@ -40,7 +40,7 @@ CXXFLAGS+= -Du_int32_t=uint32_t
SED_TRANSFORMS= -e 's,@BIGENDIAN@,0,' -e 's,@LINUX_API@,0,'
SED_TRANSFORMS+= -e 's,u_int8_t,uint8_t,g'
SED_TRANSFORMS+= -e 's,u_int16_t,uint16_t,g'
-SED_TRANSFORMS+= -e 's,u_int32_t,uint32_t,g'
+SED_TRANSFORMS+= -e 's,u_int32_t,uint32_t,g'
SED_TRANSFORMS+= -e "s,@prefix@,${PREFIX},g"
SED_TRANSFORMS+= -e "s,@exec_prefix@,${PREFIX},g"
SED_TRANSFORMS+= -e "s,@LIBUSB_VERSION@,${PKGVERSION_NOREV},g"
diff --git a/devel/libusb/distinfo b/devel/libusb/distinfo
index f4206528d06..1918c2a3893 100644
--- a/devel/libusb/distinfo
+++ b/devel/libusb/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.24 2013/12/16 15:31:05 jperkin Exp $
+$NetBSD: distinfo,v 1.25 2015/10/25 10:18:34 wiz Exp $
SHA1 (libusb-0.1.12.tar.gz) = 599a5168590f66bc6f1f9a299579fd8500614807
RMD160 (libusb-0.1.12.tar.gz) = 63848df717e00fff67ab30ba86a85466370d4e8e
@@ -6,7 +6,7 @@ Size (libusb-0.1.12.tar.gz) = 389343 bytes
SHA1 (patch-aa) = 1da6c46e8b41d7846032922bbef8a0b5eb1ae68b
SHA1 (patch-ab) = bc4756536ce7b2cc49d0c7c48c249f146f185839
SHA1 (patch-ac) = cc92318e0979779f6ef03ee653bc94ee2b96a055
-SHA1 (patch-ad) = f81135a5f92bf0c2e1ca921368bd39482bd3b580
+SHA1 (patch-ad) = 7cfa10d66f2257da55249fb8c7b20d313e560302
SHA1 (patch-ae) = 49a01ebe66de4965f3611cf42db09703aa68c415
SHA1 (patch-af) = e46e576a589fb65488011a41df95f744230c0c6c
SHA1 (patch-darwin.c) = 20df5d5970bf86f6f4ada002ca16a3bccf5bb4ff
diff --git a/devel/libusb/patches/patch-ad b/devel/libusb/patches/patch-ad
index a10e8fe7e9b..f0af40ae8b4 100644
--- a/devel/libusb/patches/patch-ad
+++ b/devel/libusb/patches/patch-ad
@@ -1,6 +1,6 @@
-$NetBSD: patch-ad,v 1.9 2007/10/11 18:25:19 drochner Exp $
+$NetBSD: patch-ad,v 1.10 2015/10/25 10:18:34 wiz Exp $
---- bsd.c.orig 2006-03-04 03:52:46.000000000 +0100
+--- bsd.c.orig 2006-03-04 02:52:46.000000000 +0000
+++ bsd.c
@@ -25,8 +25,8 @@
* for both read and write.
@@ -123,7 +123,7 @@ $NetBSD: patch-ad,v 1.9 2007/10/11 18:25:19 drochner Exp $
fprintf (stderr, "usb_interrupt_read: got negative open file descriptor for endpoint %d\n", UE_GET_ADDR(ep));
#else
fprintf (stderr, "usb_interrupt_read: got negative open file descriptor for endpoint %02d\n", UE_GET_ADDR(ep));
-@@ -429,9 +433,10 @@ int usb_interrupt_read(usb_dev_handle *d
+@@ -429,17 +433,19 @@ int usb_interrupt_read(usb_dev_handle *d
USB_ERROR_STR(-errno, "error setting short xfer: %s", strerror(errno));
do {
@@ -136,16 +136,18 @@ $NetBSD: patch-ad,v 1.9 2007/10/11 18:25:19 drochner Exp $
USB_ERROR_STR(-errno, "error reading from interrupt endpoint %s.%d: %s",
dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
#else
-@@ -439,7 +444,7 @@ int usb_interrupt_read(usb_dev_handle *d
+ USB_ERROR_STR(-errno, "error reading from interrupt endpoint %s.%02d: %s",
dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
#endif
- retrieved += ret;
+- retrieved += ret;
- } while (ret > 0 && retrieved < size);
-+ } while (ret > 0 && retrieved < size && ret == requested);
++ else
++ retrieved += ret;
++ } while (ret > 0 && retrieved < size && ret != requested);
return retrieved;
}
-@@ -477,7 +482,7 @@ int usb_control_msg(usb_dev_handle *dev,
+@@ -477,7 +483,7 @@ int usb_control_msg(usb_dev_handle *dev,
USB_ERROR_STR(-errno, "error sending control message: %s",
strerror(errno));
@@ -154,7 +156,7 @@ $NetBSD: patch-ad,v 1.9 2007/10/11 18:25:19 drochner Exp $
}
int usb_os_find_busses(struct usb_bus **busses)
-@@ -548,7 +553,7 @@ int usb_os_find_devices(struct usb_bus *
+@@ -548,7 +554,7 @@ int usb_os_find_devices(struct usb_bus *
/* best not to play with things we don't understand */
continue;
@@ -163,7 +165,7 @@ $NetBSD: patch-ad,v 1.9 2007/10/11 18:25:19 drochner Exp $
snprintf(buf, sizeof(buf) - 1, "/dev/%s", di.udi_devnames[0]);
#else
snprintf(buf, sizeof(buf) - 1, "/dev/%s.00", di.udi_devnames[0]);
-@@ -574,7 +579,7 @@ int usb_os_find_devices(struct usb_bus *
+@@ -574,7 +580,7 @@ int usb_os_find_devices(struct usb_bus *
/* we need to report the device name as /dev/ugenx NOT /dev/ugenx.00
* This seemed easier than having 2 variables...
*/