Commits

Anonymous committed 901b898

recovery: remove O_DIRECT, use O_SYNC only

O_DIRECT writes fail with EINVAL due to alignment issues.

Change-Id: If8cf38a636313e4f4b4e61e66287dc903c473e5b

  • Participants
  • Parent commits e8d953a
  • Tags android-4.3.1_r1, android-4.3_r2.1 4
    1. android-4.3_r2.2
    2. android-4.3_r2.3
    3. android-4.3_r3
    4. android-4.3_r3.1

Comments (0)

Files changed (1)

applypatch/applypatch.c

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