diff options
author | Tao Bao <tbao@google.com> | 2018-07-13 21:48:45 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-07-13 21:48:45 +0200 |
commit | 603b7ed470e98843cd97c31e50e149518616fde0 (patch) | |
tree | 81909b18c39e8fa0e37f18d887a0482cef39c50a /updater | |
parent | Merge "tests: Clean up the temporary dirs post-run." (diff) | |
parent | Merge "applypatch: Consolidate CacheSizeCheck() and MakeFreeSpaceOnCache()." (diff) | |
download | android_bootable_recovery-603b7ed470e98843cd97c31e50e149518616fde0.tar android_bootable_recovery-603b7ed470e98843cd97c31e50e149518616fde0.tar.gz android_bootable_recovery-603b7ed470e98843cd97c31e50e149518616fde0.tar.bz2 android_bootable_recovery-603b7ed470e98843cd97c31e50e149518616fde0.tar.lz android_bootable_recovery-603b7ed470e98843cd97c31e50e149518616fde0.tar.xz android_bootable_recovery-603b7ed470e98843cd97c31e50e149518616fde0.tar.zst android_bootable_recovery-603b7ed470e98843cd97c31e50e149518616fde0.zip |
Diffstat (limited to 'updater')
-rw-r--r-- | updater/blockimg.cpp | 6 | ||||
-rw-r--r-- | updater/install.cpp | 2 |
2 files changed, 4 insertions, 4 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; diff --git a/updater/install.cpp b/updater/install.cpp index ba7bd55b0..f9333459b 100644 --- a/updater/install.cpp +++ b/updater/install.cpp @@ -686,7 +686,7 @@ Value* ApplyPatchSpaceFn(const char* name, State* state, } // Skip the cache size check if the update is a retry. - if (state->is_retry || CacheSizeCheck(bytes) == 0) { + if (state->is_retry || CheckAndFreeSpaceOnCache(bytes)) { return StringValue("t"); } return StringValue(""); |