diff options
Diffstat (limited to 'tools/idevicebackup.c')
| -rw-r--r-- | tools/idevicebackup.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index 6626020..0994e47 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c | |||
| @@ -857,12 +857,6 @@ int main(int argc, char *argv[]) | |||
| 857 | } | 857 | } |
| 858 | } | 858 | } |
| 859 | 859 | ||
| 860 | /* close down the lockdown connection as it is no longer needed */ | ||
| 861 | if (client) { | ||
| 862 | lockdownd_client_free(client); | ||
| 863 | client = NULL; | ||
| 864 | } | ||
| 865 | |||
| 866 | mobilebackup_error_t err; | 860 | mobilebackup_error_t err; |
| 867 | 861 | ||
| 868 | /* Manifest.plist (backup manifest (backup state)) */ | 862 | /* Manifest.plist (backup manifest (backup state)) */ |
| @@ -902,6 +896,12 @@ int main(int argc, char *argv[]) | |||
| 902 | plist_free(info_plist); | 896 | plist_free(info_plist); |
| 903 | info_plist = NULL; | 897 | info_plist = NULL; |
| 904 | 898 | ||
| 899 | /* close down the lockdown connection as it is no longer needed */ | ||
| 900 | if (client) { | ||
| 901 | lockdownd_client_free(client); | ||
| 902 | client = NULL; | ||
| 903 | } | ||
| 904 | |||
| 905 | /* create Status.plist with failed status for now */ | 905 | /* create Status.plist with failed status for now */ |
| 906 | mobilebackup_write_status(backup_directory, 0); | 906 | mobilebackup_write_status(backup_directory, 0); |
| 907 | 907 | ||
| @@ -1133,7 +1133,14 @@ int main(int argc, char *argv[]) | |||
| 1133 | } | 1133 | } |
| 1134 | break; | 1134 | break; |
| 1135 | case CMD_RESTORE: | 1135 | case CMD_RESTORE: |
| 1136 | /* close down the lockdown connection as it is no longer needed */ | ||
| 1137 | if (client) { | ||
| 1138 | lockdownd_client_free(client); | ||
| 1139 | client = NULL; | ||
| 1140 | } | ||
| 1141 | |||
| 1136 | /* TODO: verify battery on AC enough battery remaining */ | 1142 | /* TODO: verify battery on AC enough battery remaining */ |
| 1143 | |||
| 1137 | /* verify if Status.plist says we read from an successful backup */ | 1144 | /* verify if Status.plist says we read from an successful backup */ |
| 1138 | if (mobilebackup_read_status(backup_directory) <= 0) { | 1145 | if (mobilebackup_read_status(backup_directory) <= 0) { |
| 1139 | printf("ERROR: Cannot ensure we restore from a successful backup. Aborting.\n"); | 1146 | printf("ERROR: Cannot ensure we restore from a successful backup. Aborting.\n"); |
| @@ -1287,8 +1294,6 @@ int main(int argc, char *argv[]) | |||
| 1287 | if (err != MOBILEBACKUP_E_SUCCESS) { | 1294 | if (err != MOBILEBACKUP_E_SUCCESS) { |
| 1288 | printf("ERROR: Could not send BackupMessageRestoreComplete, error code %d\n", err); | 1295 | printf("ERROR: Could not send BackupMessageRestoreComplete, error code %d\n", err); |
| 1289 | } | 1296 | } |
| 1290 | /* TODO: close down notification_proxy connection */ | ||
| 1291 | client = NULL; | ||
| 1292 | break; | 1297 | break; |
| 1293 | case CMD_LEAVE: | 1298 | case CMD_LEAVE: |
| 1294 | default: | 1299 | default: |
