diff options
author | Doug Zongker <dougz@android.com> | 2013-07-11 12:31:25 -0700 |
---|---|---|
committer | Doug Zongker <dougz@android.com> | 2013-07-11 12:31:25 -0700 |
commit | 901b898d5e4d7cc555974b8132f83f948f8fbaee (patch) | |
tree | 41e1a7b19590dda198d6acf6e710bc7ad13720bb | |
parent | e8d953aa7ed0c16beb1b03a05d16cb23dd85e198 (diff) | |
download | bootable_recovery-901b898d5e4d7cc555974b8132f83f948f8fbaee.zip bootable_recovery-901b898d5e4d7cc555974b8132f83f948f8fbaee.tar.gz bootable_recovery-901b898d5e4d7cc555974b8132f83f948f8fbaee.tar.bz2 |
recovery: remove O_DIRECT, use O_SYNC only
O_DIRECT writes fail with EINVAL due to alignment issues.
Change-Id: If8cf38a636313e4f4b4e61e66287dc903c473e5b
-rw-r--r-- | applypatch/applypatch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/applypatch/applypatch.c b/applypatch/applypatch.c index 60e26ed..0dcdce0 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 | O_DIRECT | O_SYNC); + int fd = open(partition, O_RDWR | 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 O_DIRECT write %s attempt %d start at %d\n", partition, attempt+1, start); + printf("raw O_SYNC 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; |