- Fixes '[|]' whitespace
[openocd.git] / contrib / libftdi / libftdi-0.12_win32.patch
blob426523c7bfa479ea48821a0deb27a5c13169fb9c
1 --- src/ftdi.c.orig Wed Apr 16 16:24:30 2008
2 +++ src/ftdi.c Thu May 01 20:19:46 2008
3 @@ -358,6 +358,17 @@
4 if (usb_detach_kernel_driver_np(ftdi->usb_dev, ftdi->interface) != 0 && errno != ENODATA)
5 detach_errno = errno;
6 #endif
8 +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
9 + if (usb_set_configuration(ftdi->usb_dev, 1) != 0) {
10 + usb_close (ftdi->usb_dev);
11 + if (detach_errno == EPERM) {
12 + ftdi_error_return(-8, "inappropriate permissions on device!");
13 + } else {
14 + ftdi_error_return(-5, "unable to set configuration");
15 + }
16 + }
17 +#endif
19 if (usb_claim_interface(ftdi->usb_dev, ftdi->interface) != 0) {
20 usb_close (ftdi->usb_dev);