summaryrefslogtreecommitdiffstats
path: root/updater/blockimg.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-07-12 00:55:32 +0200
committerTao Bao <tbao@google.com>2018-07-13 18:42:19 +0200
commit5ee25666cc819e9ebc9b72c7a44c4bc9bab9e4e3 (patch)
treeeeadaddce1095a7f53dbc86941de0a00b5325b8d /updater/blockimg.cpp
parentMerge "tests: Clean up the temporary dirs post-run." (diff)
downloadandroid_bootable_recovery-5ee25666cc819e9ebc9b72c7a44c4bc9bab9e4e3.tar
android_bootable_recovery-5ee25666cc819e9ebc9b72c7a44c4bc9bab9e4e3.tar.gz
android_bootable_recovery-5ee25666cc819e9ebc9b72c7a44c4bc9bab9e4e3.tar.bz2
android_bootable_recovery-5ee25666cc819e9ebc9b72c7a44c4bc9bab9e4e3.tar.lz
android_bootable_recovery-5ee25666cc819e9ebc9b72c7a44c4bc9bab9e4e3.tar.xz
android_bootable_recovery-5ee25666cc819e9ebc9b72c7a44c4bc9bab9e4e3.tar.zst
android_bootable_recovery-5ee25666cc819e9ebc9b72c7a44c4bc9bab9e4e3.zip
Diffstat (limited to 'updater/blockimg.cpp')
-rw-r--r--updater/blockimg.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index 6a6236b1b..2a2ab19a3 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -827,7 +827,7 @@ static int WriteStash(const std::string& base, const std::string& id, int blocks
return -1;
}
- if (checkspace && CacheSizeCheck(blocks * BLOCKSIZE) != 0) {
+ if (checkspace && !CheckAndFreeSpaceOnCache(blocks * BLOCKSIZE)) {
LOG(ERROR) << "not enough space to write stash";
return -1;
}
@@ -919,7 +919,7 @@ static int CreateStash(State* state, size_t maxblocks, const std::string& base)
return -1;
}
- if (CacheSizeCheck(max_stash_size) != 0) {
+ if (!CheckAndFreeSpaceOnCache(max_stash_size)) {
ErrorAbort(state, kStashCreationFailure, "not enough space for stash (%zu needed)",
max_stash_size);
return -1;
@@ -951,7 +951,7 @@ static int CreateStash(State* state, size_t maxblocks, const std::string& base)
if (max_stash_size > existing) {
size_t needed = max_stash_size - existing;
- if (CacheSizeCheck(needed) != 0) {
+ if (!CheckAndFreeSpaceOnCache(needed)) {
ErrorAbort(state, kStashCreationFailure, "not enough space for stash (%zu more needed)",
needed);
return -1;