Promote free bytes calculation to 64 bits

The expression otherwise overflows for large devices.
It's fsblkcnt_t -> unsigned long, which is 32 bit on ARMv7.

Bug: 25162062
Change-Id: I46c5e00558b7dbd6abd50fae4727396079044df2
gugelfrei
Oleksiy Avramchenko 9 years ago committed by Jeff Sharkey
parent 89f74fbf25
commit 2403b4d056

@ -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;
}

Loading…
Cancel
Save