From c2b410e55a78b3607401bc794b627e212f68e4ad Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 29 Nov 2012 17:24:04 +0100 Subject: 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. --- tools/idevicebackup2.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tools/idevicebackup2.c') 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); } -- cgit v1.1-32-gdbae