diff options
author | Martin Szulecki | 2014-10-02 00:42:33 +0200 |
---|---|---|
committer | Martin Szulecki | 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 debug("opening device %04x:%04x...\n", usb_descriptor.idVendor, usb_descriptor.idProduct); - libusb_open(usb_device, &usb_handle); - if (usb_handle == NULL) { - debug("%s: can't connect to device...\n", __func__); + int libusb_error = libusb_open(usb_device, &usb_handle); + if (usb_handle == NULL || libusb_error != 0) { + debug("%s: can't connect to device: %s\n", __func__, libusb_error_name(libusb_error)); + libusb_close(usb_handle); if (ecid != 0) { continue; |