summaryrefslogtreecommitdiffstats
path: root/applypatch/applypatch.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2013-07-11 21:09:05 +0200
committerDoug Zongker <dougz@android.com>2013-07-11 21:11:11 +0200
commite8d953aa7ed0c16beb1b03a05d16cb23dd85e198 (patch)
tree5958ccb6508883c4cf80afb343dd5e3e645978de /applypatch/applypatch.c
parentrecovery: sleep after writing partition and closing it (diff)
downloadandroid_bootable_recovery-e8d953aa7ed0c16beb1b03a05d16cb23dd85e198.tar
android_bootable_recovery-e8d953aa7ed0c16beb1b03a05d16cb23dd85e198.tar.gz
android_bootable_recovery-e8d953aa7ed0c16beb1b03a05d16cb23dd85e198.tar.bz2
android_bootable_recovery-e8d953aa7ed0c16beb1b03a05d16cb23dd85e198.tar.lz
android_bootable_recovery-e8d953aa7ed0c16beb1b03a05d16cb23dd85e198.tar.xz
android_bootable_recovery-e8d953aa7ed0c16beb1b03a05d16cb23dd85e198.tar.zst
android_bootable_recovery-e8d953aa7ed0c16beb1b03a05d16cb23dd85e198.zip
Diffstat (limited to '')
-rw-r--r--applypatch/applypatch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/applypatch/applypatch.c b/applypatch/applypatch.c
index 2c62a0636..60e26ede3 100644
--- a/applypatch/applypatch.c
+++ b/applypatch/applypatch.c
@@ -424,7 +424,7 @@ int WriteToPartition(unsigned char* data, size_t len,
{
size_t start = 0;
int success = 0;
- int fd = open(partition, O_RDWR);
+ int fd = open(partition, O_RDWR | O_DIRECT | O_SYNC);
if (fd < 0) {
printf("failed to open %s: %s\n", partition, strerror(errno));
return -1;
@@ -433,7 +433,7 @@ int WriteToPartition(unsigned char* data, size_t len,
for (attempt = 0; attempt < 10; ++attempt) {
size_t next_sync = start + (1<<20);
- printf("raw write %s attempt %d start at %d\n", partition, attempt+1, start);
+ printf("raw O_DIRECT write %s attempt %d start at %d\n", partition, attempt+1, start);
lseek(fd, start, SEEK_SET);
while (start < len) {
size_t to_write = len - start;