summaryrefslogtreecommitdiffstats
path: root/applypatch
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2013-07-11 10:17:48 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-11 10:17:48 -0700
commit65c37aa0d328d7bb13d121bd59ab784361335bd8 (patch)
tree9358cc08c4cc1b3057871428d2c525c1f9709546 /applypatch
parentf5edbd107a234e989a6d765046c13293842b66cc (diff)
parentfbcfad33face5d3b9e6b8cb04379168bceb517df (diff)
downloadbootable_recovery-65c37aa0d328d7bb13d121bd59ab784361335bd8.zip
bootable_recovery-65c37aa0d328d7bb13d121bd59ab784361335bd8.tar.gz
bootable_recovery-65c37aa0d328d7bb13d121bd59ab784361335bd8.tar.bz2
am fbcfad33: am bf4a69ac: recovery: sleep after writing partition and closing it
* commit 'fbcfad33face5d3b9e6b8cb04379168bceb517df': recovery: sleep after writing partition and closing it
Diffstat (limited to 'applypatch')
-rw-r--r--applypatch/applypatch.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/applypatch/applypatch.c b/applypatch/applypatch.c
index 8308176..5d469ad 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;
}
}