summaryrefslogtreecommitdiffstats
path: root/src/recovery.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-09-25 19:23:20 +0200
committerGravatar Nikias Bassen2019-09-25 19:23:20 +0200
commit3050e61588bfc79b3b360fa25db32c81e3264efb (patch)
tree30d981d1aedd9f2879b328c22ad7e512523821d2 /src/recovery.c
parentd50525b400be1be9ab266c19634f8bad3dcfe935 (diff)
downloadidevicerestore-3050e61588bfc79b3b360fa25db32c81e3264efb.tar.gz
idevicerestore-3050e61588bfc79b3b360fa25db32c81e3264efb.tar.bz2
Use global event handlers for normale/restore and recovery/dfu mode devices
Diffstat (limited to 'src/recovery.c')
-rw-r--r--src/recovery.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/recovery.c b/src/recovery.c
index 436261f..c079d90 100644
--- a/src/recovery.c
+++ b/src/recovery.c
@@ -231,7 +231,13 @@ int recovery_enter_restore(struct idevicerestore_client_t* client, plist_t build
return -1;
}
- client->mode = &idevicerestore_modes[MODE_RESTORE];
+ debug("DEBUG: Waiting for device to disconnect...\n");
+ WAIT_FOR(client->mode != &idevicerestore_modes[MODE_RECOVERY] || (client->flags & FLAG_QUIT), 30);
+ if (client->mode == &idevicerestore_modes[MODE_RECOVERY]) {
+ error("ERROR: Failed to place device in restore mode\n");
+ return -1;
+ }
+
return 0;
}