summaryrefslogtreecommitdiffstats
path: root/tools/irecovery.c
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/irecovery.c
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/irecovery.c')
-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[]) {
459 for (i = 0; i <= 5; i++) { 459 for (i = 0; i <= 5; i++) {
460 debug("Attempting to connect... \n"); 460 debug("Attempting to connect... \n");
461 461
462 if (irecv_open_with_ecid(&client, ecid) != IRECV_E_SUCCESS) 462 irecv_error_t err = irecv_open_with_ecid(&client, ecid);
463 if (err == IRECV_E_UNSUPPORTED) {
464 fprintf(stderr, "ERROR: %s\n", irecv_strerror(err));
465 return -1;
466 }
467 else if (err != IRECV_E_SUCCESS)
463 sleep(1); 468 sleep(1);
464 else 469 else
465 break; 470 break;
466 471
467 if (i == 5) { 472 if (i == 5) {
473 fprintf(stderr, "ERROR: %s\n", irecv_strerror(err));
468 return -1; 474 return -1;
469 } 475 }
470 } 476 }