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

Commit e81719dd authored by Tao Bao's avatar Tao Bao Committed by Gerrit Code Review
Browse files

Merge "Bugfix:updater always retry apply patch failed,when memcpy failed."

parents 26d972c9 9a6f5204
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -332,6 +332,17 @@ int WriteToPartition(const unsigned char* data, size_t len, const std::string& t
      success = true;
      break;
    }

    if (ota_close(fd) != 0) {
      printf("failed to close %s: %s\n", partition, strerror(errno));
      return -1;
    }

    fd.reset(ota_open(partition, O_RDWR));
    if (fd == -1) {
      printf("failed to reopen %s for retry write && verify: %s\n", partition, strerror(errno));
      return -1;
    }
  }

  if (!success) {