summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-06-09 02:08:09 +0200
committerGravatar Martin Szulecki2010-06-09 02:08:09 +0200
commite08b61eb2d9af499e3f154c6c1c37312cbd55a37 (patch)
tree4cb55bedf723d8959338bb3d0d0521c46f4b1b6a
parentd42659ca68fab96f6a4c2bbaa132d16c1a391ea8 (diff)
downloadlibimobiledevice-e08b61eb2d9af499e3f154c6c1c37312cbd55a37.tar.gz
libimobiledevice-e08b61eb2d9af499e3f154c6c1c37312cbd55a37.tar.bz2
idevicebackup: Fix broken backup due to closing down lockdown too early
-rw-r--r--tools/idevicebackup.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c
index 6626020..0994e47 100644
--- a/tools/idevicebackup.c
+++ b/tools/idevicebackup.c
@@ -857,12 +857,6 @@ int main(int argc, char *argv[])
}
}
- /* close down the lockdown connection as it is no longer needed */
- if (client) {
- lockdownd_client_free(client);
- client = NULL;
- }
-
mobilebackup_error_t err;
/* Manifest.plist (backup manifest (backup state)) */
@@ -902,6 +896,12 @@ int main(int argc, char *argv[])
plist_free(info_plist);
info_plist = NULL;
+ /* close down the lockdown connection as it is no longer needed */
+ if (client) {
+ lockdownd_client_free(client);
+ client = NULL;
+ }
+
/* create Status.plist with failed status for now */
mobilebackup_write_status(backup_directory, 0);
@@ -1133,7 +1133,14 @@ int main(int argc, char *argv[])
}
break;
case CMD_RESTORE:
+ /* close down the lockdown connection as it is no longer needed */
+ if (client) {
+ lockdownd_client_free(client);
+ client = NULL;
+ }
+
/* TODO: verify battery on AC enough battery remaining */
+
/* verify if Status.plist says we read from an successful backup */
if (mobilebackup_read_status(backup_directory) <= 0) {
printf("ERROR: Cannot ensure we restore from a successful backup. Aborting.\n");
@@ -1287,8 +1294,6 @@ int main(int argc, char *argv[])
if (err != MOBILEBACKUP_E_SUCCESS) {
printf("ERROR: Could not send BackupMessageRestoreComplete, error code %d\n", err);
}
- /* TODO: close down notification_proxy connection */
- client = NULL;
break;
case CMD_LEAVE:
default: