summaryrefslogtreecommitdiffstats
path: root/applypatch/applypatch.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2010-08-13 18:41:21 +0200
committerDoug Zongker <dougz@android.com>2010-08-13 18:41:21 +0200
commit201cd46680f5789e21a57fb4476ab0ba0c0ed4c0 (patch)
treeaba530f55ad47dd1dee46bdb06a1c766a23b8cdd /applypatch/applypatch.c
parentfix bug in applying patches (diff)
downloadandroid_bootable_recovery-201cd46680f5789e21a57fb4476ab0ba0c0ed4c0.tar
android_bootable_recovery-201cd46680f5789e21a57fb4476ab0ba0c0ed4c0.tar.gz
android_bootable_recovery-201cd46680f5789e21a57fb4476ab0ba0c0ed4c0.tar.bz2
android_bootable_recovery-201cd46680f5789e21a57fb4476ab0ba0c0ed4c0.tar.lz
android_bootable_recovery-201cd46680f5789e21a57fb4476ab0ba0c0ed4c0.tar.xz
android_bootable_recovery-201cd46680f5789e21a57fb4476ab0ba0c0ed4c0.tar.zst
android_bootable_recovery-201cd46680f5789e21a57fb4476ab0ba0c0ed4c0.zip
Diffstat (limited to 'applypatch/applypatch.c')
-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);