summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>2015-10-01 12:44:46 +0200
committerJeff Sharkey <jsharkey@android.com>2015-10-21 16:01:29 -0700
commit2403b4d0561c756ed5102aaf6048a80c9993f6f8 (patch)
tree08a7bf090d2c78815b5a01e0541618a287e088ea
parent89f74fbf2529d708534c041d2b711af0f1feff9f (diff)
downloadvold-marshmallow-mr1-dev.tar.gz
The expression otherwise overflows for large devices. It's fsblkcnt_t -> unsigned long, which is 32 bit on ARMv7. Bug: 25162062 Change-Id: I46c5e00558b7dbd6abd50fae4727396079044df2
-rw-r--r--Utils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Utils.cpp b/Utils.cpp
index f352e841..279c990a 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -432,7 +432,7 @@ status_t NormalizeHex(const std::string& in, std::string& out) {
uint64_t GetFreeBytes(const std::string& path) {
struct statvfs sb;
if (statvfs(path.c_str(), &sb) == 0) {
- return sb.f_bfree * sb.f_bsize;
+ return (uint64_t)sb.f_bfree * sb.f_bsize;
} else {
return -1;
}