Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Snippets Groups Projects
Commit 660637f3 authored by Doug Zongker's avatar Doug Zongker Committed by Android Git Automerger
Browse files

am e8d953aa: recovery: more cargo-cult programming

* commit 'e8d953aa':
  recovery: more cargo-cult programming
parents 51ffaf54 e8d953aa
Branches
No related tags found
No related merge requests found
...@@ -424,7 +424,7 @@ int WriteToPartition(unsigned char* data, size_t len, ...@@ -424,7 +424,7 @@ int WriteToPartition(unsigned char* data, size_t len,
{ {
size_t start = 0; size_t start = 0;
int success = 0; int success = 0;
int fd = open(partition, O_RDWR); int fd = open(partition, O_RDWR | O_DIRECT | O_SYNC);
if (fd < 0) { if (fd < 0) {
printf("failed to open %s: %s\n", partition, strerror(errno)); printf("failed to open %s: %s\n", partition, strerror(errno));
return -1; return -1;
...@@ -433,7 +433,7 @@ int WriteToPartition(unsigned char* data, size_t len, ...@@ -433,7 +433,7 @@ int WriteToPartition(unsigned char* data, size_t len,
for (attempt = 0; attempt < 10; ++attempt) { for (attempt = 0; attempt < 10; ++attempt) {
size_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); printf("raw O_DIRECT write %s attempt %d start at %d\n", partition, attempt+1, start);
lseek(fd, start, SEEK_SET); lseek(fd, start, SEEK_SET);
while (start < len) { while (start < len) {
size_t to_write = len - start; size_t to_write = len - start;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment