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
This commit is contained in:
Oleksiy Avramchenko 2015-10-01 12:44:46 +02:00 committed by Jeff Sharkey
parent 89f74fbf25
commit 2403b4d056

View file

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