summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-11-29 17:24:04 +0100
committerGravatar Nikias Bassen2012-11-29 17:24:04 +0100
commitc2b410e55a78b3607401bc794b627e212f68e4ad (patch)
treecffdf46cc6022d1a486d541ac895f691ab10064e
parent37401693ad6547e4ea272e8419ab8995230c3fed (diff)
downloadlibimobiledevice-c2b410e55a78b3607401bc794b627e212f68e4ad.tar.gz
libimobiledevice-c2b410e55a78b3607401bc794b627e212f68e4ad.tar.bz2
idevicebackup2: suppress "Can't remove" warning about Manifest.mbdx
This file is not used anymore since iOS 5.0 but the device's BackupAgent2 is still requesting the deletion of this file. To not confuse the user we just suppress the warning if the file could not be deleted.
-rw-r--r--tools/idevicebackup2.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index eeb2718..856c41c 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -1639,6 +1639,13 @@ checkpoint:
char *str = NULL;
plist_get_string_val(val, &str);
if (str) {
+ const char *checkfile = strchr(str, '/');
+ int suppress_warning = 0;
+ if (checkfile) {
+ if (strcmp(checkfile+1, "Manifest.mbdx") == 0) {
+ suppress_warning = 1;
+ }
+ }
char *newpath = build_path(backup_directory, str, NULL);
free(str);
#ifdef WIN32
@@ -1650,13 +1657,15 @@ checkpoint:
res = DeleteFile(newpath);
if (!res) {
int e = win32err_to_errno(GetLastError());
- printf("Could not remove '%s': %s (%d)\n", newpath, strerror(e), e);
+ if (!suppress_warning)
+ printf("Could not remove '%s': %s (%d)\n", newpath, strerror(e), e);
errcode = errno_to_device_error(e);
errdesc = strerror(e);
}
#else
if (remove(newpath) < 0) {
- printf("Could not remove '%s': %s (%d)\n", newpath, strerror(errno), errno);
+ if (!suppress_warning)
+ printf("Could not remove '%s': %s (%d)\n", newpath, strerror(errno), errno);
errcode = errno_to_device_error(errno);
errdesc = strerror(errno);
}