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

Commit 737e6cc6 authored by Ng Zhi An's avatar Ng Zhi An Committed by android-build-merger
Browse files

Merge "Check that install file exists before unlink" am: 05d48050

am: a04ff295

Change-Id: I00c9323e3c774f25d4c746e439d8c50bb75935b6
parents 73a460b0 a04ff295
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ int main(int argc, char **argv) {
      // Collects and reports the non-a/b update metrics from last_install; and removes the file
      // to avoid duplicate report.
      report_metrics_from_last_install(LAST_INSTALL_FILE_IN_CACHE);
      if (unlink(LAST_INSTALL_FILE_IN_CACHE) == -1) {
      if (access(LAST_INSTALL_FILE_IN_CACHE, F_OK) && unlink(LAST_INSTALL_FILE_IN_CACHE) == -1) {
        PLOG(ERROR) << "Failed to unlink " << LAST_INSTALL_FILE_IN_CACHE;
      }

@@ -182,7 +182,7 @@ int main(int argc, char **argv) {
    // /data/misc/recovery from pmsg. Looks for the sideload history only.
    if (!has_cache) {
      report_metrics_from_last_install(LAST_INSTALL_FILE);
      if (unlink(LAST_INSTALL_FILE) == -1) {
      if (access(LAST_INSTALL_FILE, F_OK) && unlink(LAST_INSTALL_FILE) == -1) {
        PLOG(ERROR) << "Failed to unlink " << LAST_INSTALL_FILE;
      }
    }