summaryrefslogtreecommitdiffstats
path: root/src/libirecovery.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-10-02 00:42:33 +0200
committerGravatar Martin Szulecki2014-10-02 00:42:33 +0200
commitec1e5190b4a2f9b56500fee0bcd747cedac1426b (patch)
tree9d6b7c85b29771d53a33ffb6872cf925fa08349b /src/libirecovery.c
parent9aa1bcc510fb95fd3e9391f948388e553d6779ff (diff)
downloadlibirecovery-ec1e5190b4a2f9b56500fee0bcd747cedac1426b.tar.gz
libirecovery-ec1e5190b4a2f9b56500fee0bcd747cedac1426b.tar.bz2
Add libusb error to debug message when connecting to a device failed
Diffstat (limited to 'src/libirecovery.c')
-rw-r--r--src/libirecovery.c7
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;