summaryrefslogtreecommitdiffstats
path: root/Utils.cpp
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2017-04-04 02:05:21 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-04-04 02:05:21 +0000
commit246779028f7c6a186867ef988e0c8580b8a69179 (patch)
treea59ef803be4baea2b7b951b0d9b41d7be50a9e42 /Utils.cpp
parentc1a67979054a25067b3a524c3cb870c6d10109af (diff)
parenta4c0a3b2ca41659c4cbb2666c259b63a9a90a900 (diff)
downloadandroid_system_vold-246779028f7c6a186867ef988e0c8580b8a69179.tar.gz
android_system_vold-246779028f7c6a186867ef988e0c8580b8a69179.tar.bz2
android_system_vold-246779028f7c6a186867ef988e0c8580b8a69179.zip
Merge "Abort migration early when not enough space." into oc-dev am: e6c142174c
am: a4c0a3b2ca Change-Id: Ie50f0ae2dbf7eb1b868606b75d1ade808d34590b
Diffstat (limited to 'Utils.cpp')
-rw-r--r--Utils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Utils.cpp b/Utils.cpp
index 8bdae92..050a92b 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 (uint64_t)sb.f_bfree * sb.f_bsize;
+ return (uint64_t) sb.f_bavail * sb.f_frsize;
} else {
return -1;
}