From 3e4694043b0767acede31102f403b4ee8cbb076e Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Mon, 25 Jan 2010 15:40:47 +0100 Subject: Use backup_ok to depict final backup success status in iphonebackup --- tools/iphonebackup.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/iphonebackup.c b/tools/iphonebackup.c index f7f1ff1..3fe3a3f 100644 --- a/tools/iphonebackup.c +++ b/tools/iphonebackup.c @@ -420,6 +420,9 @@ int main(int argc, char *argv[]) break; } + /* reset backup status */ + backup_ok = 0; + /* receive and save DLSendFile files and metadata, ACK each */ int file_index = 0; uint64_t backup_real_size = 0; @@ -600,13 +603,19 @@ int main(int argc, char *argv[]) printf("Storing Manifest.plist...\n"); plist_write_to_filename(manifest_plist, manifest_path, PLIST_FORMAT_XML); } - - /* create: Status.plist (Info on how the backup process turned out) */ - printf("Backup Successful.\n"); - mobilebackup_write_status(backup_directory, 1); + + backup_ok = 1; } } + if (backup_ok) { + /* create: Status.plist (Info on how the backup process turned out) */ + printf("Backup Successful.\n"); + mobilebackup_write_status(backup_directory, 1); + } else { + printf("Backup Failed.\n"); + } + if (manifest_path) g_free(manifest_path); -- cgit v1.1-32-gdbae