summaryrefslogtreecommitdiffstats
path: root/tools/idevicebackup2.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2011-04-28 19:44:22 +0200
committerGravatar Martin Szulecki2011-04-28 19:44:22 +0200
commitbc03e4c80d1035a633ae0c921c44d5725785b8aa (patch)
tree870326e2fd63224344a6f7e20bc98e4d11d02b10 /tools/idevicebackup2.c
parentd9d8fc2f9f90fdd77c971e45c3be8e9b0548e9d4 (diff)
downloadlibimobiledevice-bc03e4c80d1035a633ae0c921c44d5725785b8aa.tar.gz
libimobiledevice-bc03e4c80d1035a633ae0c921c44d5725785b8aa.tar.bz2
idevicebackup2: Use errno_to_device_error() for other operations, too
Diffstat (limited to 'tools/idevicebackup2.c')
-rw-r--r--tools/idevicebackup2.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index 006dd33..1219601 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -1491,10 +1491,9 @@ checkpoint:
1491 gchar *oldpath = g_build_path(G_DIR_SEPARATOR_S, backup_directory, key, NULL); 1491 gchar *oldpath = g_build_path(G_DIR_SEPARATOR_S, backup_directory, key, NULL);
1492 1492
1493 remove(newpath); 1493 remove(newpath);
1494 //fprintf(stderr, "Moving '%s' to '%s'\n", oldpath, newpath);
1495 if (rename(oldpath, newpath) < 0) { 1494 if (rename(oldpath, newpath) < 0) {
1496 printf("Renameing '%s' to '%s' failed: %s (%d)\n", oldpath, newpath, strerror(errno), errno); 1495 printf("Renameing '%s' to '%s' failed: %s (%d)\n", oldpath, newpath, strerror(errno), errno);
1497 errcode = -errno; 1496 errcode = errno_to_device_error(errno);
1498 errdesc = strerror(errno); 1497 errdesc = strerror(errno);
1499 break; 1498 break;
1500 } 1499 }
@@ -1532,8 +1531,8 @@ checkpoint:
1532 g_free(str); 1531 g_free(str);
1533 if (remove(newpath) < 0) { 1532 if (remove(newpath) < 0) {
1534 printf("Could not remove '%s': %s (%d)\n", newpath, strerror(errno), errno); 1533 printf("Could not remove '%s': %s (%d)\n", newpath, strerror(errno), errno);
1535 //errcode = -errno; 1534 errcode = errno_to_device_error(errno);
1536 //errdesc = strerror(errno); 1535 errdesc = strerror(errno);
1537 } 1536 }
1538 g_free(newpath); 1537 g_free(newpath);
1539 } 1538 }