OSDN Git Service

Revert "ART: Unlink target oat file before compiling"
authorAndreas Gampe <agampe@google.com>
Tue, 30 Jun 2015 17:47:40 +0000 (10:47 -0700)
committerAndreas Gampe <agampe@google.com>
Tue, 30 Jun 2015 17:47:40 +0000 (10:47 -0700)
Change to the old code before changing CreateEmptyFile.

This reverts commit 4591ae27de90988fbcb9af0c942e633f97ab454e.

Bug: 22047255

dex2oat/dex2oat.cc

index 74d5c0c..7a23746 100644 (file)
@@ -1038,10 +1038,6 @@ class Dex2Oat FINAL {
   bool OpenFile() {
     bool create_file = !oat_unstripped_.empty();  // as opposed to using open file descriptor
     if (create_file) {
-      // We're supposed to create this file. If the file already exists, it may be in use currently.
-      // We must not change the content of that file, then. So unlink it first.
-      unlink(oat_unstripped_.c_str());
-
       oat_file_.reset(OS::CreateEmptyFile(oat_unstripped_.c_str()));
       if (oat_location_.empty()) {
         oat_location_ = oat_filename_;