summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-10-20 02:59:05 +0200
committerGravatar Nikias Bassen2019-10-20 03:00:06 +0200
commit4086188a6fd124d948807ad57408dbdad7fac511 (patch)
tree62e2e565a6fabe4ac7b189f9b3783e86e73371eb
parent38e7b85fdde8b3dbf697535f439c96c53564ee72 (diff)
downloadidevicerestore-4086188a6fd124d948807ad57408dbdad7fac511.tar.gz
idevicerestore-4086188a6fd124d948807ad57408dbdad7fac511.tar.bz2
Allow cancelling the 'waiting for trust' loop, and don't spam console in debug mode while waiting for it
-rw-r--r--src/normal.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/normal.c b/src/normal.c
index 4104f33..c05ed9d 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -165,13 +165,22 @@ irecv_device_t normal_get_irecv_device(struct idevicerestore_client_t* client)
lockdown_error = lockdownd_client_new_with_handshake(device, &lockdown, "idevicerestore");
if (!(client->flags & FLAG_ERASE) && lockdown_error == LOCKDOWN_E_PAIRING_DIALOG_RESPONSE_PENDING) {
info("*** Device is not paired with this computer. Please trust this computer on the device to continue. ***\n");
- while (1) {
+ if (client->flags & FLAG_DEBUG) {
+ idevice_set_debug_level(0);
+ }
+ while (!(client->flags & FLAG_QUIT)) {
lockdown_error = lockdownd_client_new_with_handshake(device, &lockdown, "idevicerestore");
if (lockdown_error != LOCKDOWN_E_PAIRING_DIALOG_RESPONSE_PENDING) {
break;
}
sleep(1);
}
+ if (client->flags & FLAG_DEBUG) {
+ idevice_set_debug_level(1);
+ }
+ if (client->flags & FLAG_QUIT) {
+ return NULL;
+ }
}
if (lockdown_error != LOCKDOWN_E_SUCCESS) {
lockdown_error = lockdownd_client_new(device, &lockdown, "idevicerestore");