diff options
author | Tianjie Xu <xunchang@google.com> | 2018-04-13 22:33:21 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-04-13 22:33:21 +0200 |
commit | 8982db6ae1913e7e1866986605a080699be6980b (patch) | |
tree | 68bd13f062360a4a868543480e37c123866c785b /applypatch/applypatch.cpp | |
parent | Merge "install: mkfs.f2fs: specify sector size for target image size" (diff) | |
parent | Merge "Remove the old log files if cache space is insufficient for OTA" (diff) | |
download | android_bootable_recovery-8982db6ae1913e7e1866986605a080699be6980b.tar android_bootable_recovery-8982db6ae1913e7e1866986605a080699be6980b.tar.gz android_bootable_recovery-8982db6ae1913e7e1866986605a080699be6980b.tar.bz2 android_bootable_recovery-8982db6ae1913e7e1866986605a080699be6980b.tar.lz android_bootable_recovery-8982db6ae1913e7e1866986605a080699be6980b.tar.xz android_bootable_recovery-8982db6ae1913e7e1866986605a080699be6980b.tar.zst android_bootable_recovery-8982db6ae1913e7e1866986605a080699be6980b.zip |
Diffstat (limited to 'applypatch/applypatch.cpp')
-rw-r--r-- | applypatch/applypatch.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp index 7645a4005..6f6c187be 100644 --- a/applypatch/applypatch.cpp +++ b/applypatch/applypatch.cpp @@ -436,13 +436,13 @@ static size_t FileSink(const unsigned char* data, size_t len, int fd) { // Return the amount of free space (in bytes) on the filesystem // containing filename. filename must exist. Return -1 on error. -size_t FreeSpaceForFile(const char* filename) { - struct statfs sf; - if (statfs(filename, &sf) != 0) { - printf("failed to statfs %s: %s\n", filename, strerror(errno)); - return -1; - } - return sf.f_bsize * sf.f_bavail; +size_t FreeSpaceForFile(const std::string& filename) { + struct statfs sf; + if (statfs(filename.c_str(), &sf) != 0) { + printf("failed to statfs %s: %s\n", filename.c_str(), strerror(errno)); + return -1; + } + return sf.f_bsize * sf.f_bavail; } int CacheSizeCheck(size_t bytes) { |