From 54340f40090ce73d524821e5b724e37f0da9733b Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 4 Jun 2010 13:12:33 +0200 Subject: idevicebackup: use manifest_path for restore too --- tools/idevicebackup.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index cacacc4..b3b073a 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c @@ -594,15 +594,15 @@ int main(int argc, char *argv[]) } } + /* Manifest.plist (backup manifest (backup state)) */ + char *manifest_path = mobilebackup_build_path(backup_directory, "Manifest", ".plist"); + switch(cmd) { case CMD_BACKUP: printf("Starting backup...\n"); /* TODO: check domain com.apple.mobile.backup key RequiresEncrypt and WillEncrypt with lockdown */ /* TODO: verify battery on AC enough battery remaining */ - /* Manifest.plist (backup manifest (backup state)) */ - char *manifest_path = mobilebackup_build_path(backup_directory, "Manifest", ".plist"); - /* read the last Manifest.plist */ if (!is_full_backup) { printf("Reading existing Manifest.\n"); @@ -866,10 +866,6 @@ int main(int argc, char *argv[]) } else { printf("Backup Failed.\n"); } - - if (manifest_path) - g_free(manifest_path); - break; case CMD_RESTORE: /* TODO: verify battery on AC enough battery remaining */ @@ -902,6 +898,8 @@ int main(int argc, char *argv[]) lockfile = 0; do_post_notification(NP_SYNC_DID_FINISH); } + if (manifest_path) + g_free(manifest_path); } else { printf("ERROR: Could not start service %s.\n", MOBILEBACKUP_SERVICE_NAME); lockdownd_client_free(client); -- cgit v1.1-32-gdbae