summaryrefslogtreecommitdiff
path: root/cmds/installd/utils.cpp
diff options
context:
space:
mode:
author Jeff Sharkey <jsharkey@android.com> 2017-04-02 23:29:30 -0600
committer Jeff Sharkey <jsharkey@android.com> 2017-04-02 23:29:32 -0600
commita836c472f017f09cf16fa68176df461a4958d22a (patch)
tree2aa7785e3356b217bbc700d20c2af0ce689bd3c4 /cmds/installd/utils.cpp
parentc3bae03442d8e7e9f46b3cf754d51a738a40f4a9 (diff)
We really want f_frsize.
It's confusing, but f_bsize is not the value you're looking for; the real block size is f_frsize. Fix all those bugs. Test: builds, boots Bug: 36840579 Change-Id: I2846b8998c27f3e9a71dbf573a0a22158215a3bd
Diffstat (limited to 'cmds/installd/utils.cpp')
-rw-r--r--cmds/installd/utils.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmds/installd/utils.cpp b/cmds/installd/utils.cpp
index fbe6edf712..943df0fca9 100644
--- a/cmds/installd/utils.cpp
+++ b/cmds/installd/utils.cpp
@@ -629,11 +629,10 @@ int copy_dir_files(const char *srcname,
return res;
}
-int64_t data_disk_free(const std::string& data_path)
-{
+int64_t data_disk_free(const std::string& data_path) {
struct statvfs sfs;
if (statvfs(data_path.c_str(), &sfs) == 0) {
- return sfs.f_bavail * sfs.f_bsize;
+ return sfs.f_bavail * sfs.f_frsize;
} else {
PLOG(ERROR) << "Couldn't statvfs " << data_path;
return -1;