summaryrefslogtreecommitdiffstats
path: root/partitionmanager.cpp
diff options
context:
space:
mode:
authorbigbiff bigbiff <bigbiff@teamw.in>2013-02-19 16:09:21 +0100
committerDees_Troy <dees_troy@teamw.in>2013-02-19 19:08:03 +0100
commit2c57d789df1e23f3c311036dc5de240867142be5 (patch)
tree7fc5220eeef70f33b74ffeaf6fddf561b17e3d8f /partitionmanager.cpp
parentAdd MTK6575/6577 EMMC partitions backup support (diff)
downloadandroid_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar.gz
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar.bz2
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar.lz
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar.xz
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.tar.zst
android_bootable_recovery-2c57d789df1e23f3c311036dc5de240867142be5.zip
Diffstat (limited to 'partitionmanager.cpp')
-rw-r--r--partitionmanager.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 19efd424a..bcabb1ca4 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -521,7 +521,8 @@ bool TWPartitionManager::Make_MD5(bool generate_md5, string Backup_Folder, strin
bool TWPartitionManager::Backup_Partition(TWPartition* Part, string Backup_Folder, bool generate_md5, unsigned long long* img_bytes_remaining, unsigned long long* file_bytes_remaining, unsigned long *img_time, unsigned long *file_time, unsigned long long *img_bytes, unsigned long long *file_bytes) {
time_t start, stop;
- int img_bps, file_bps;
+ int img_bps;
+ unsigned long long file_bps;
unsigned long total_time, remain_time, section_time;
int use_compression, backup_time;
float pos;
@@ -644,8 +645,9 @@ int TWPartitionManager::Run_Backup(void) {
backup_sys = Find_Partition_By_Path("/system");
if (backup_sys != NULL) {
partition_count++;
- if (backup_sys->Backup_Method == 1)
+ if (backup_sys->Backup_Method == 1) {
file_bytes += backup_sys->Backup_Size;
+ }
else
img_bytes += backup_sys->Backup_Size;
} else {
@@ -852,9 +854,9 @@ int TWPartitionManager::Run_Backup(void) {
if (file_time == 0)
file_time = 1;
int img_bps = (int)img_bytes / (int)img_time;
- int file_bps = (int)file_bytes / (int)file_time;
+ unsigned long long file_bps = file_bytes / (int)file_time;
- ui_print("Average backup rate for file systems: %lu MB/sec\n", (file_bps / (1024 * 1024)));
+ ui_print("Average backup rate for file systems: %llu MB/sec\n", (file_bps / (1024 * 1024)));
ui_print("Average backup rate for imaged drives: %lu MB/sec\n", (img_bps / (1024 * 1024)));
time(&total_stop);
@@ -862,7 +864,8 @@ int TWPartitionManager::Run_Backup(void) {
unsigned long long actual_backup_size = TWFunc::Get_Folder_Size(Full_Backup_Path, true);
actual_backup_size /= (1024LLU * 1024LLU);
- int prev_img_bps, prev_file_bps, use_compression;
+ int prev_img_bps, use_compression;
+ unsigned long long prev_file_bps;
DataManager::GetValue(TW_BACKUP_AVG_IMG_RATE, prev_img_bps);
img_bps += (prev_img_bps * 4);
img_bps /= 5;