summaryrefslogtreecommitdiffstats
path: root/tools/iphonebackup.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/iphonebackup.c')
-rw-r--r--tools/iphonebackup.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/iphonebackup.c b/tools/iphonebackup.c
index f0cfa7a..781f9d3 100644
--- a/tools/iphonebackup.c
+++ b/tools/iphonebackup.c
@@ -558,6 +558,7 @@ int main(int argc, char *argv[])
558 mobilebackup_send(mobilebackup, message); 558 mobilebackup_send(mobilebackup, message);
559 plist_free(message); 559 plist_free(message);
560 message = NULL; 560 message = NULL;
561 node = NULL;
561 562
562 /* get response */ 563 /* get response */
563 int backup_ok = 0; 564 int backup_ok = 0;
@@ -739,13 +740,21 @@ int main(int argc, char *argv[])
739 if (quit_flag > 0) { 740 if (quit_flag > 0) {
740 /* need to cancel the backup here */ 741 /* need to cancel the backup here */
741 mobilebackup_cancel_backup_with_error("Cancelling DLSendFile"); 742 mobilebackup_cancel_backup_with_error("Cancelling DLSendFile");
743
744 /* remove any atomic Manifest.plist.tmp */
745 if (manifest_path)
746 g_free(manifest_path);
747
748 manifest_path = mobilebackup_build_path(backup_directory, "Manifest", ".plist.tmp");
749 if (stat(manifest_path, &st) == 0)
750 remove(manifest_path);
742 break; 751 break;
743 } 752 }
744 } while (1); 753 } while (1);
745 754
746 printf("Received %d files from device.\n", file_index); 755 printf("Received %d files from device.\n", file_index);
747 756
748 if (!plist_strcmp(node, "DLMessageProcessMessage")) { 757 if (!quit_flag && !plist_strcmp(node, "DLMessageProcessMessage")) {
749 node_tmp = plist_array_get_item(message, 1); 758 node_tmp = plist_array_get_item(message, 1);
750 node = plist_dict_get_item(node_tmp, "BackupMessageTypeKey"); 759 node = plist_dict_get_item(node_tmp, "BackupMessageTypeKey");
751 /* check if we received the final "backup finished" message */ 760 /* check if we received the final "backup finished" message */
@@ -791,9 +800,6 @@ int main(int argc, char *argv[])
791 if (manifest_path) 800 if (manifest_path)
792 g_free(manifest_path); 801 g_free(manifest_path);
793 802
794 if (node)
795 plist_free(node);
796
797 break; 803 break;
798 case CMD_RESTORE: 804 case CMD_RESTORE:
799 printf("Restoring backup is NOT IMPLEMENTED.\n"); 805 printf("Restoring backup is NOT IMPLEMENTED.\n");