summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dex2oat/dex2oat.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index b6a7683a54..3848b6def0 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -420,10 +420,6 @@ static size_t OpenDexFiles(const std::vector<const char*>& dex_filenames,
LOG(WARNING) << "Failed to open .dex from file '" << dex_filename << "'\n";
++failure_count;
} else {
- // Ensure writable for dex-to-dex transformations.
- if (!dex_file->EnableWrite()) {
- PLOG(ERROR) << "Failed to make .dex file writeable '" << dex_filename << "'\n";
- }
dex_files.push_back(dex_file);
}
}
@@ -923,6 +919,13 @@ static int dex2oat(int argc, char** argv) {
return EXIT_FAILURE;
}
}
+
+ // Ensure opened dex files are writable for dex-to-dex transformations.
+ for (const auto& dex_file : dex_files) {
+ if (!dex_file->EnableWrite()) {
+ PLOG(ERROR) << "Failed to make .dex file writeable '" << dex_file->GetLocation() << "'\n";
+ }
+ }
}
/*