Commit daf2c9b9fa6f65b93f76baed0f1dd7c79378596f

Con Kolivas 2013-12-10T06:39:21

Only set LIBUSB_TRANSFER_ADD_ZERO_PACKET for libusb versions we know include support for.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/usbutils.c b/usbutils.c
index aa3ae4e..83468d2 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -2471,7 +2471,11 @@ pipe_retry:
 
 	if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT) {
 		memcpy(buf, data, length);
+#ifndef HAVE_LIBUSB
+		/* Older versions may not have this feature so only enable it
+		 * when we know we're compiling with included static libusb */
 		ut.transfer->flags |= LIBUSB_TRANSFER_ADD_ZERO_PACKET;
+#endif
 #ifdef WIN32
 		/* Writes on windows really don't like to be cancelled, but
 		 * are prone to timeouts under heavy USB traffic, so make this