diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp
index 13e4b1a..12e1399 100644
--- a/applypatch/applypatch.cpp
+++ b/applypatch/applypatch.cpp
@@ -420,14 +420,6 @@
   return done;
 }
 
-int CacheSizeCheck(size_t bytes) {
-  if (MakeFreeSpaceOnCache(bytes) < 0) {
-    LOG(ERROR) << "Failed to make " << bytes << " bytes available on /cache";
-    return 1;
-  }
-  return 0;
-}
-
 int applypatch(const char* source_filename, const char* target_filename,
                const char* target_sha1_str, size_t /* target_size */,
                const std::vector<std::string>& patch_sha1s,
@@ -562,8 +554,8 @@
 
   CHECK(android::base::StartsWith(target_filename, "EMMC:"));
 
-  // We still write the original source to cache, in case the partition write is interrupted.
-  if (MakeFreeSpaceOnCache(source_file.data.size()) < 0) {
+  // We write the original source to cache, in case the partition write is interrupted.
+  if (!CheckAndFreeSpaceOnCache(source_file.data.size())) {
     LOG(ERROR) << "Not enough free space on /cache";
     return 1;
   }
diff --git a/applypatch/freecache.cpp b/applypatch/freecache.cpp
index 4989b74..e487865 100644
--- a/applypatch/freecache.cpp
+++ b/applypatch/freecache.cpp
@@ -150,22 +150,22 @@
   return free_space;
 }
 
-int MakeFreeSpaceOnCache(size_t bytes_needed) {
+bool CheckAndFreeSpaceOnCache(size_t bytes) {
 #ifndef __ANDROID__
   // TODO(xunchang): Implement a heuristic cache size check during host simulation.
-  LOG(WARNING) << "Skipped making (" << bytes_needed
+  LOG(WARNING) << "Skipped making (" << bytes
                << ") bytes free space on /cache; program is running on host";
-  return 0;
+  return true;
 #endif
 
   std::vector<std::string> dirs{ "/cache", Paths::Get().cache_log_directory() };
   for (const auto& dirname : dirs) {
-    if (RemoveFilesInDirectory(bytes_needed, dirname, FreeSpaceForFile)) {
-      return 0;
+    if (RemoveFilesInDirectory(bytes, dirname, FreeSpaceForFile)) {
+      return true;
     }
   }
 
-  return -1;
+  return false;
 }
 
 bool RemoveFilesInDirectory(size_t bytes_needed, const std::string& dirname,
diff --git a/applypatch/include/applypatch/applypatch.h b/applypatch/include/applypatch/applypatch.h
index 88659b8..28dba7e 100644
--- a/applypatch/include/applypatch/applypatch.h
+++ b/applypatch/include/applypatch/applypatch.h
@@ -40,10 +40,6 @@
 
 int ShowLicenses();
 
-// Checks whether /cache partition has at least 'bytes'-byte free space. Returns 0 on having
-// sufficient space.
-int CacheSizeCheck(size_t bytes);
-
 // Parses a given string of 40 hex digits into 20-byte array 'digest'. 'str' may contain only the
 // digest or be of the form "<digest>:<anything>". Returns 0 on success, or -1 on any error.
 int ParseSha1(const std::string& str, uint8_t* digest);
@@ -113,7 +109,10 @@
 
 // freecache.cpp
 
-int MakeFreeSpaceOnCache(size_t bytes_needed);
+// Checks whether /cache partition has at least 'bytes'-byte free space. Returns true immediately
+// if so. Otherwise, it will try to free some space by removing older logs, checks again and
+// returns the checking result.
+bool CheckAndFreeSpaceOnCache(size_t bytes);
 
 // Removes the files in |dirname| until we have at least |bytes_needed| bytes of free space on the
 // partition. |space_checker| should return the size of the free space, or -1 on error.
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index 6a6236b..2a2ab19 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -827,7 +827,7 @@
     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 @@
       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 @@
 
   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 d0be955..088d24b 100644
--- a/updater/install.cpp
+++ b/updater/install.cpp
@@ -688,7 +688,7 @@
   }
 
   // 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("");
