summaryrefslogtreecommitdiffstats
path: root/src/recovery.c
diff options
context:
space:
mode:
authorGravatar Joshua Hill2010-06-22 03:08:45 -0400
committerGravatar Joshua Hill2010-06-22 03:08:45 -0400
commit9ac5edef25cf7e084a639c2e70f9f7e963d96152 (patch)
tree896b2c7a436e840388e69a9c0325008ffc330d1d /src/recovery.c
parentb27dd3c4bbe2915fd7c35383ef283e222b422829 (diff)
downloadidevicerestore-9ac5edef25cf7e084a639c2e70f9f7e963d96152.tar.gz
idevicerestore-9ac5edef25cf7e084a639c2e70f9f7e963d96152.tar.bz2
Added info for iPhone4 and fixed a few runtime errors
Diffstat (limited to 'src/recovery.c')
-rw-r--r--src/recovery.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/recovery.c b/src/recovery.c
index 290f368..fbcc49c 100644
--- a/src/recovery.c
+++ b/src/recovery.c
@@ -45,6 +45,7 @@ int recovery_client_new(struct idevicerestore_client_t* client) {
error("ERROR: Out of memory\n");
return -1;
}
+ client->recovery = recovery;
if (recovery_open_with_timeout(client) < 0) {
recovery_client_free(client);
@@ -74,6 +75,14 @@ int recovery_open_with_timeout(struct idevicerestore_client_t* client) {
irecv_client_t recovery = NULL;
irecv_error_t recovery_error = IRECV_E_UNKNOWN_ERROR;
+ if(client->recovery == NULL) {
+ if(recovery_client_new(client) < 0) {
+ error("ERROR: Unable to open device in recovery mode\n");
+ return -1;
+ }
+ return 0;
+ }
+
for (i = 1; i <= attempts; i++) {
recovery_error = irecv_open(&recovery);
if (recovery_error == IRECV_E_SUCCESS) {