summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicebackup.c4
-rw-r--r--tools/idevicebackup2.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c
index 2619cc9..7e825de 100644
--- a/tools/idevicebackup.c
+++ b/tools/idevicebackup.c
@@ -251,7 +251,7 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid)
if (value_node)
plist_dict_set_item(ret, "IMEI", plist_copy(value_node));
- plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0));
+ plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL) - MAC_EPOCH, 0));
value_node = plist_dict_get_item(root_node, "ProductType");
plist_dict_set_item(ret, "Product Type", plist_copy(value_node));
@@ -288,7 +288,7 @@ static void mobilebackup_info_update_last_backup_date(plist_t info_plist)
return;
node = plist_dict_get_item(info_plist, "Last Backup Date");
- plist_set_date_val(node, time(NULL), 0);
+ plist_set_date_val(node, time(NULL) - MAC_EPOCH, 0);
node = NULL;
}
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index 934cf39..be5a1a0 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -146,10 +146,10 @@ static void mobilebackup_afc_get_file_contents(afc_client_t afc, const char *fil
uint32_t bread = 0;
afc_file_read(afc, f, buf+done, 65536, &bread);
if (bread > 0) {
+ done += bread;
} else {
break;
}
- done += bread;
}
if (done == fsize) {
*size = fsize;
@@ -223,7 +223,7 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid, lockdownd_c
if (value_node)
plist_dict_set_item(ret, "IMEI", plist_copy(value_node));
- plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0));
+ plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL) - MAC_EPOCH, 0));
value_node = plist_dict_get_item(root_node, "PhoneNumber");
if (value_node && (plist_get_node_type(value_node) == PLIST_STRING)) {
@@ -914,7 +914,8 @@ static void mb2_handle_list_directory(mobilebackup2_client_t mobilebackup2, plis
}
plist_dict_set_item(fdict, "DLFileType", plist_new_string(ftype));
plist_dict_set_item(fdict, "DLFileSize", plist_new_uint(st.st_size));
- plist_dict_set_item(fdict, "DLFileModificationDate", plist_new_date(st.st_mtime, 0));
+ plist_dict_set_item(fdict, "DLFileModificationDate",
+ plist_new_date(st.st_mtime - MAC_EPOCH, 0));
plist_dict_set_item(dirlist, ep->d_name, fdict);
free(fpath);