diff options
| author | 2010-06-04 13:15:42 +0200 | |
|---|---|---|
| committer | 2010-06-04 13:15:42 +0200 | |
| commit | 25efbcec53dad60019bfae92a8bc9769ed171e56 (patch) | |
| tree | 91e2a68ab8f825e2a61ad4819ffd4ccdc2d177b2 | |
| parent | 54340f40090ce73d524821e5b724e37f0da9733b (diff) | |
| download | libimobiledevice-25efbcec53dad60019bfae92a8bc9769ed171e56.tar.gz libimobiledevice-25efbcec53dad60019bfae92a8bc9769ed171e56.tar.bz2 | |
idevicebackup: don't use lockfile and sync notification for restore
| -rw-r--r-- | tools/idevicebackup.c | 18 |
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[]) | |||
| 536 | printf("ERROR: Could not start service %s.\n", NP_SERVICE_NAME); | 536 | printf("ERROR: Could not start service %s.\n", NP_SERVICE_NAME); |
| 537 | } | 537 | } |
| 538 | 538 | ||
| 539 | /* start AFC, we need this for the lock file */ | ||
| 540 | afc_client_t afc = NULL; | 539 | afc_client_t afc = NULL; |
| 541 | port = 0; | 540 | if (cmd == CMD_BACKUP) { |
| 542 | ret = lockdownd_start_service(client, "com.apple.afc", &port); | 541 | /* start AFC, we need this for the lock file */ |
| 543 | if ((ret == LOCKDOWN_E_SUCCESS) && port) { | 542 | port = 0; |
| 544 | afc_client_new(phone, port, &afc); | 543 | ret = lockdownd_start_service(client, "com.apple.afc", &port); |
| 544 | if ((ret == LOCKDOWN_E_SUCCESS) && port) { | ||
| 545 | afc_client_new(phone, port, &afc); | ||
| 546 | } | ||
| 545 | } | 547 | } |
| 546 | 548 | ||
| 547 | /* start mobilebackup service and retrieve port */ | 549 | /* start mobilebackup service and retrieve port */ |
| @@ -581,9 +583,11 @@ int main(int argc, char *argv[]) | |||
| 581 | is_full_backup = 1; | 583 | is_full_backup = 1; |
| 582 | } | 584 | } |
| 583 | 585 | ||
| 584 | do_post_notification(NP_SYNC_WILL_START); | ||
| 585 | uint64_t lockfile = 0; | 586 | uint64_t lockfile = 0; |
| 586 | afc_file_open(afc, "/com.apple.itunes.lock_sync", AFC_FOPEN_RW, &lockfile); | 587 | if (cmd == CMD_BACKUP) { |
| 588 | do_post_notification(NP_SYNC_WILL_START); | ||
| 589 | afc_file_open(afc, "/com.apple.itunes.lock_sync", AFC_FOPEN_RW, &lockfile); | ||
| 590 | } | ||
| 587 | if (lockfile) { | 591 | if (lockfile) { |
| 588 | do_post_notification(NP_SYNC_LOCK_REQUEST); | 592 | do_post_notification(NP_SYNC_LOCK_REQUEST); |
| 589 | if (afc_file_lock(afc, lockfile, AFC_LOCK_EX) == AFC_E_SUCCESS) { | 593 | if (afc_file_lock(afc, lockfile, AFC_LOCK_EX) == AFC_E_SUCCESS) { |
