diff options
author | 2017-03-22 21:27:40 -0600 | |
---|---|---|
committer | 2017-03-22 21:27:46 -0600 | |
commit | ed909ae8db2f44ce7fe7003c6fee457f13669702 (patch) | |
tree | d57c4f275cfa2cc1684abeb9748d0e17098f0f42 /cmds/installd/utils.cpp | |
parent | 7459281f9e1d999281260ff4bbdf3d3e5e0459f5 (diff) |
Follow "atomic" to "group" refactoring.
Remove noisy logging about UIDs that are relying on default cache
quota of 64MiB.
Move away from yucky old statfs() and use statvfs() instead.
Test: /data/nativetest/installd_cache_test/installd_cache_test
Bug: 35812899, 35684969, 36482620
Change-Id: I3d68da97eac2ebcda489bdf9d27061cac5b3f7cc
Diffstat (limited to 'cmds/installd/utils.cpp')
-rw-r--r-- | cmds/installd/utils.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/cmds/installd/utils.cpp b/cmds/installd/utils.cpp index 97298e5e62..03ee23f1a8 100644 --- a/cmds/installd/utils.cpp +++ b/cmds/installd/utils.cpp @@ -23,12 +23,7 @@ #include <sys/stat.h> #include <sys/wait.h> #include <sys/xattr.h> - -#if defined(__APPLE__) -#include <sys/mount.h> -#else -#include <sys/statfs.h> -#endif +#include <sys/statvfs.h> #include <android-base/logging.h> #include <android-base/stringprintf.h> @@ -637,11 +632,11 @@ int copy_dir_files(const char *srcname, int64_t data_disk_free(const std::string& data_path) { - struct statfs sfs; - if (statfs(data_path.c_str(), &sfs) == 0) { + struct statvfs sfs; + if (statvfs(data_path.c_str(), &sfs) == 0) { return sfs.f_bavail * sfs.f_bsize; } else { - PLOG(ERROR) << "Couldn't statfs " << data_path; + PLOG(ERROR) << "Couldn't statvfs " << data_path; return -1; } } |