Commits

Anonymous committed 660637f Merge

am e8d953aa: recovery: more cargo-cult programming

* commit 'e8d953aa7ed0c16beb1b03a05d16cb23dd85e198':
recovery: more cargo-cult programming

Comments (0)

Files changed (1)

applypatch/applypatch.c

         {
             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;
 
             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;