summaryrefslogtreecommitdiffstats
path: root/tools/idevicebackup2.c
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 /tools/idevicebackup2.c
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.
Diffstat (limited to 'tools/idevicebackup2.c')
-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:
1639 char *str = NULL; 1639 char *str = NULL;
1640 plist_get_string_val(val, &str); 1640 plist_get_string_val(val, &str);
1641 if (str) { 1641 if (str) {
1642 const char *checkfile = strchr(str, '/');
1643 int suppress_warning = 0;
1644 if (checkfile) {
1645 if (strcmp(checkfile+1, "Manifest.mbdx") == 0) {
1646 suppress_warning = 1;
1647 }
1648 }
1642 char *newpath = build_path(backup_directory, str, NULL); 1649 char *newpath = build_path(backup_directory, str, NULL);
1643 free(str); 1650 free(str);
1644#ifdef WIN32 1651#ifdef WIN32
@@ -1650,13 +1657,15 @@ checkpoint:
1650 res = DeleteFile(newpath); 1657 res = DeleteFile(newpath);
1651 if (!res) { 1658 if (!res) {
1652 int e = win32err_to_errno(GetLastError()); 1659 int e = win32err_to_errno(GetLastError());
1653 printf("Could not remove '%s': %s (%d)\n", newpath, strerror(e), e); 1660 if (!suppress_warning)
1661 printf("Could not remove '%s': %s (%d)\n", newpath, strerror(e), e);
1654 errcode = errno_to_device_error(e); 1662 errcode = errno_to_device_error(e);
1655 errdesc = strerror(e); 1663 errdesc = strerror(e);
1656 } 1664 }
1657#else 1665#else
1658 if (remove(newpath) < 0) { 1666 if (remove(newpath) < 0) {
1659 printf("Could not remove '%s': %s (%d)\n", newpath, strerror(errno), errno); 1667 if (!suppress_warning)
1668 printf("Could not remove '%s': %s (%d)\n", newpath, strerror(errno), errno);
1660 errcode = errno_to_device_error(errno); 1669 errcode = errno_to_device_error(errno);
1661 errdesc = strerror(errno); 1670 errdesc = strerror(errno);
1662 } 1671 }