summaryrefslogtreecommitdiffstats
path: root/applypatch/applypatch.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2013-07-10 22:39:50 +0200
committerThe Android Automerger <android-build@android.com>2013-07-11 03:25:21 +0200
commit166565f9fb3034f7e7f60f6614cff754d94a4078 (patch)
treeeb922d629fa13a7fe27ac1bfdcfb38645e1b39b5 /applypatch/applypatch.c
parentrecovery: write partitions more conservatively (diff)
downloadandroid_bootable_recovery-166565f9fb3034f7e7f60f6614cff754d94a4078.tar
android_bootable_recovery-166565f9fb3034f7e7f60f6614cff754d94a4078.tar.gz
android_bootable_recovery-166565f9fb3034f7e7f60f6614cff754d94a4078.tar.bz2
android_bootable_recovery-166565f9fb3034f7e7f60f6614cff754d94a4078.tar.lz
android_bootable_recovery-166565f9fb3034f7e7f60f6614cff754d94a4078.tar.xz
android_bootable_recovery-166565f9fb3034f7e7f60f6614cff754d94a4078.tar.zst
android_bootable_recovery-166565f9fb3034f7e7f60f6614cff754d94a4078.zip
Diffstat (limited to '')
-rw-r--r--applypatch/applypatch.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/applypatch/applypatch.c b/applypatch/applypatch.c
index 3f67c32df..2c62a0636 100644
--- a/applypatch/applypatch.c
+++ b/applypatch/applypatch.c
@@ -432,7 +432,7 @@ int WriteToPartition(unsigned char* data, size_t len,
int attempt;
for (attempt = 0; attempt < 10; ++attempt) {
- off_t next_sync = start + (1<<20);
+ size_t next_sync = start + (1<<20);
printf("raw write %s attempt %d start at %d\n", partition, attempt+1, start);
lseek(fd, start, SEEK_SET);
while (start < len) {
@@ -487,7 +487,7 @@ int WriteToPartition(unsigned char* data, size_t len,
return -1;
}
}
- if (read_count < to_read) {
+ if ((size_t)read_count < to_read) {
printf("short verify read %s at %d: %d %d %s\n",
partition, p, read_count, to_read, strerror(errno));
}
@@ -519,6 +519,11 @@ int WriteToPartition(unsigned char* data, size_t len,
printf("error closing %s (%s)\n", partition, strerror(errno));
return -1;
}
+ // hack: sync and sleep after closing in hopes of getting
+ // the data actually onto flash.
+ printf("sleeping after close\n");
+ sync();
+ sleep(5);
break;
}
}