summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2010-06-04 13:15:42 +0200
committerGravatar Nikias Bassen2010-06-04 13:15:42 +0200
commit25efbcec53dad60019bfae92a8bc9769ed171e56 (patch)
tree91e2a68ab8f825e2a61ad4819ffd4ccdc2d177b2 /tools
parent54340f40090ce73d524821e5b724e37f0da9733b (diff)
downloadlibimobiledevice-25efbcec53dad60019bfae92a8bc9769ed171e56.tar.gz
libimobiledevice-25efbcec53dad60019bfae92a8bc9769ed171e56.tar.bz2
idevicebackup: don't use lockfile and sync notification for restore
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicebackup.c18
1 files changed, 11 insertions, 7 deletions
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) {