Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This broke the standard Context::open function...
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
default_pre_build && | ||
|
||
# make cmake report correct C++ library | ||
sedit 's/ftdi1pp/ftdipp1/' CMakeLists.txt | ||
sedit 's/ftdi1pp/ftdipp1/' CMakeLists.txt && | ||
|
||
patch_it $SCRIPT_DIRECTORY/libftdi1-1.1-no-double-open.diff 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
commit bc3841238bac9cb6955848fd661bbf19a5ed42c6 | ||
Author: Denis Sirotkin <reg.libftdi@demitel.ru> | ||
Date: Fri May 16 17:40:13 2014 +0200 | ||
|
||
ftdi_usb_get_strings(): Don't try to open an already open device | ||
|
||
diff --git a/src/ftdi.c b/src/ftdi.c | ||
index b6caf6c..add6dc2 100644 | ||
--- a/src/ftdi.c | ||
+++ b/src/ftdi.c | ||
@@ -413,8 +413,8 @@ int ftdi_usb_get_strings(struct ftdi_context * ftdi, struct libusb_device * dev, | ||
if ((ftdi==NULL) || (dev==NULL)) | ||
return -1; | ||
|
||
- if (libusb_open(dev, &ftdi->usb_dev) < 0) | ||
- ftdi_error_return(-4, "libusb_open() failed"); | ||
+ if (ftdi->usb_dev == NULL && libusb_open(dev, &ftdi->usb_dev) < 0) | ||
+ ftdi_error_return(-4, "libusb_open() failed"); | ||
|
||
if (libusb_get_device_descriptor(dev, &desc) < 0) | ||
ftdi_error_return(-11, "libusb_get_device_descriptor() failed"); |