summaryrefslogtreecommitdiffstats
path: root/applypatch
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2010-08-13 18:41:21 +0200
committerandroid-build SharedAccount <android-build@sekiwake.mtv.corp.google.com>2010-08-13 20:47:56 +0200
commitbeecac49da738d164ef524332224a6700791aa1e (patch)
treeb7a9ac1fea3eecd1c9b99abd921fec5319692730 /applypatch
parentSet adbd to be disabled by default in recovery (diff)
downloadandroid_bootable_recovery-beecac49da738d164ef524332224a6700791aa1e.tar
android_bootable_recovery-beecac49da738d164ef524332224a6700791aa1e.tar.gz
android_bootable_recovery-beecac49da738d164ef524332224a6700791aa1e.tar.bz2
android_bootable_recovery-beecac49da738d164ef524332224a6700791aa1e.tar.lz
android_bootable_recovery-beecac49da738d164ef524332224a6700791aa1e.tar.xz
android_bootable_recovery-beecac49da738d164ef524332224a6700791aa1e.tar.zst
android_bootable_recovery-beecac49da738d164ef524332224a6700791aa1e.zip
Diffstat (limited to 'applypatch')
-rw-r--r--applypatch/applypatch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/applypatch/applypatch.c b/applypatch/applypatch.c
index 99d366165..3c816c52e 100644
--- a/applypatch/applypatch.c
+++ b/applypatch/applypatch.c
@@ -645,7 +645,8 @@ int applypatch(const char* source_filename,
int enough_space = 0;
if (retry > 0) {
size_t free_space = FreeSpaceForFile(target_fs);
- int enough_space =
+ enough_space =
+ (free_space > (256 << 10)) && // 256k (two-block) minimum
(free_space > (target_size * 3 / 2)); // 50% margin of error
printf("target %ld bytes; free space %ld bytes; retry %d; enough %d\n",
(long)target_size, (long)free_space, retry, enough_space);