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

Commit e5a1bc62 authored by Nicolas Geoffray's avatar Nicolas Geoffray Committed by android-build-merger
Browse files

Merge "Always unlink the out_vdex_file."

am: fbb09a71

Change-Id: If1eed0f380172f05b4fbd7a8f853a9d7db6f4aa7
parents 0a1b8a11 fbb09a71
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1209,7 +1209,11 @@ bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_
    if (dexopt_action == DEX2OAT_FOR_BOOT_IMAGE &&
            in_vdex_wrapper_fd->get() != -1 &&
            in_vdex_path_str == out_vdex_path_str) {
        out_vdex_wrapper_fd->reset(in_vdex_wrapper_fd->get());
        // We unlink the file in case the invocation of dex2oat fails, to ensure we don't
        // have bogus stale vdex files.
        out_vdex_wrapper_fd->reset(
              in_vdex_wrapper_fd->get(),
              [out_vdex_path_str]() { unlink(out_vdex_path_str.c_str()); });
        // Disable auto close for the in wrapper fd (it will be done when destructing the out
        // wrapper).
        in_vdex_wrapper_fd->DisableAutoClose();