Merge "Fix the overflow issue in Checkpoint" am: 6492a6abf6 am: e4c34d9cc3 am: c8425b0e8c

Change-Id: Idb11dfdd37c5813da6676894c35acb1503199553
This commit is contained in:
Automerger Merge Worker 2020-01-14 21:30:21 +00:00
commit 636123c523

View file

@ -320,13 +320,13 @@ static void cp_healthDaemon(std::string mnt_pnt, std::string blk_device, bool is
uint64_t free_bytes = 0;
if (is_fs_cp) {
statvfs(mnt_pnt.c_str(), &data);
free_bytes = data.f_bavail * data.f_frsize;
free_bytes = ((uint64_t) data.f_bavail) * data.f_frsize;
} else {
std::string bow_device = fs_mgr_find_bow_device(blk_device);
if (!bow_device.empty()) {
std::string content;
if (android::base::ReadFileToString(bow_device + "/bow/free", &content)) {
free_bytes = std::strtoul(content.c_str(), NULL, 10);
free_bytes = std::strtoull(content.c_str(), NULL, 10);
}
}
}