summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2018-09-17 18:11:47 +0200
committerGravatar Nikias Bassen2018-09-17 18:11:47 +0200
commit4daf6d84f7271cc19256c45b52c63b99ba7b4391 (patch)
tree9329f344b20d753ee5b43bda609b6db51a2d6530 /tools
parent85d352a6bd4c4d3fef26bc1bec289254939950f9 (diff)
downloadlibirecovery-4daf6d84f7271cc19256c45b52c63b99ba7b4391.tar.gz
libirecovery-4daf6d84f7271cc19256c45b52c63b99ba7b4391.tar.bz2
Add configuration option to allow compiling without USB driver
Using --with-dummy, libirecovery can be compiled in a way that it will not require any USB driver at all. This is only useful if you just want to query libirecovery's device database by product type or hardware model, namely using: irecv_devices_get_device_by_product_type(); irecv_devices_get_device_by_hardware_model(); All other function are either no-op or return IRECV_E_UNSUPPORTED if the library is compiled this way.
Diffstat (limited to 'tools')
-rw-r--r--tools/irecovery.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/irecovery.c b/tools/irecovery.c
index f250dc5..2db6f4f 100644
--- a/tools/irecovery.c
+++ b/tools/irecovery.c
@@ -459,12 +459,18 @@ int main(int argc, char* argv[]) {
for (i = 0; i <= 5; i++) {
debug("Attempting to connect... \n");
- if (irecv_open_with_ecid(&client, ecid) != IRECV_E_SUCCESS)
+ irecv_error_t err = irecv_open_with_ecid(&client, ecid);
+ if (err == IRECV_E_UNSUPPORTED) {
+ fprintf(stderr, "ERROR: %s\n", irecv_strerror(err));
+ return -1;
+ }
+ else if (err != IRECV_E_SUCCESS)
sleep(1);
else
break;
if (i == 5) {
+ fprintf(stderr, "ERROR: %s\n", irecv_strerror(err));
return -1;
}
}