summaryrefslogtreecommitdiffstats
path: root/applypatch/include
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 /applypatch/include
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 'applypatch/include')
-rw-r--r--applypatch/include/applypatch/applypatch.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/applypatch/include/applypatch/applypatch.h b/applypatch/include/applypatch/applypatch.h
index 88659b86a..28dba7e68 100644
--- a/applypatch/include/applypatch/applypatch.h
+++ b/applypatch/include/applypatch/applypatch.h
@@ -40,10 +40,6 @@ using SinkFn = std::function<size_t(const unsigned char*, size_t)>;
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 @@ int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const Value&
// 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.