diff options
| author | 2014-10-02 00:42:33 +0200 | |
|---|---|---|
| committer | 2014-10-02 00:42:33 +0200 | |
| commit | ec1e5190b4a2f9b56500fee0bcd747cedac1426b (patch) | |
| tree | 9d6b7c85b29771d53a33ffb6872cf925fa08349b | |
| parent | 9aa1bcc510fb95fd3e9391f948388e553d6779ff (diff) | |
| download | libirecovery-ec1e5190b4a2f9b56500fee0bcd747cedac1426b.tar.gz libirecovery-ec1e5190b4a2f9b56500fee0bcd747cedac1426b.tar.bz2 | |
Add libusb error to debug message when connecting to a device failed
| -rw-r--r-- | src/libirecovery.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index 7315001..83ceefd 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -758,9 +758,10 @@ irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned long long e | |||
| 758 | 758 | ||
| 759 | debug("opening device %04x:%04x...\n", usb_descriptor.idVendor, usb_descriptor.idProduct); | 759 | debug("opening device %04x:%04x...\n", usb_descriptor.idVendor, usb_descriptor.idProduct); |
| 760 | 760 | ||
| 761 | libusb_open(usb_device, &usb_handle); | 761 | int libusb_error = libusb_open(usb_device, &usb_handle); |
| 762 | if (usb_handle == NULL) { | 762 | if (usb_handle == NULL || libusb_error != 0) { |
| 763 | debug("%s: can't connect to device...\n", __func__); | 763 | debug("%s: can't connect to device: %s\n", __func__, libusb_error_name(libusb_error)); |
| 764 | |||
| 764 | libusb_close(usb_handle); | 765 | libusb_close(usb_handle); |
| 765 | if (ecid != 0) { | 766 | if (ecid != 0) { |
| 766 | continue; | 767 | continue; |
