summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2010-08-13 19:02:51 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-13 19:02:51 +0200
commitc080bc549aaf272c77fe7903e52c2a2c0d8de1bb (patch)
tree1580e8bafbe8a12d59820ef1b591b05bc093cf0b
parentam 17986e6b: am 8cd9e4f3: fix bug in applying patches (diff)
parentam 201cd466: remove shadowed variable declaration (diff)
downloadandroid_bootable_recovery-c080bc549aaf272c77fe7903e52c2a2c0d8de1bb.tar
android_bootable_recovery-c080bc549aaf272c77fe7903e52c2a2c0d8de1bb.tar.gz
android_bootable_recovery-c080bc549aaf272c77fe7903e52c2a2c0d8de1bb.tar.bz2
android_bootable_recovery-c080bc549aaf272c77fe7903e52c2a2c0d8de1bb.tar.lz
android_bootable_recovery-c080bc549aaf272c77fe7903e52c2a2c0d8de1bb.tar.xz
android_bootable_recovery-c080bc549aaf272c77fe7903e52c2a2c0d8de1bb.tar.zst
android_bootable_recovery-c080bc549aaf272c77fe7903e52c2a2c0d8de1bb.zip
-rw-r--r--applypatch/applypatch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/applypatch/applypatch.c b/applypatch/applypatch.c
index 5debaace0..b85b91592 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);