From 25efbcec53dad60019bfae92a8bc9769ed171e56 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 4 Jun 2010 13:15:42 +0200 Subject: idevicebackup: don't use lockfile and sync notification for restore --- tools/idevicebackup.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'tools/idevicebackup.c') diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index b3b073a..58301f5 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c @@ -536,12 +536,14 @@ int main(int argc, char *argv[]) printf("ERROR: Could not start service %s.\n", NP_SERVICE_NAME); } - /* start AFC, we need this for the lock file */ afc_client_t afc = NULL; - port = 0; - ret = lockdownd_start_service(client, "com.apple.afc", &port); - if ((ret == LOCKDOWN_E_SUCCESS) && port) { - afc_client_new(phone, port, &afc); + if (cmd == CMD_BACKUP) { + /* start AFC, we need this for the lock file */ + port = 0; + ret = lockdownd_start_service(client, "com.apple.afc", &port); + if ((ret == LOCKDOWN_E_SUCCESS) && port) { + afc_client_new(phone, port, &afc); + } } /* start mobilebackup service and retrieve port */ @@ -581,9 +583,11 @@ int main(int argc, char *argv[]) is_full_backup = 1; } - do_post_notification(NP_SYNC_WILL_START); uint64_t lockfile = 0; - afc_file_open(afc, "/com.apple.itunes.lock_sync", AFC_FOPEN_RW, &lockfile); + if (cmd == CMD_BACKUP) { + do_post_notification(NP_SYNC_WILL_START); + afc_file_open(afc, "/com.apple.itunes.lock_sync", AFC_FOPEN_RW, &lockfile); + } if (lockfile) { do_post_notification(NP_SYNC_LOCK_REQUEST); if (afc_file_lock(afc, lockfile, AFC_LOCK_EX) == AFC_E_SUCCESS) { -- cgit v1.1-32-gdbae