diff options
-rw-r--r-- | dex2oat/dex2oat.cc | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 5b0653e00f..9631e2df67 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -419,10 +419,9 @@ static bool ParseInt(const char* in, int* out) { return true; } -static size_t OpenDexFiles(const std::vector<const char*>& dex_filenames, - const std::vector<const char*>& dex_locations, - std::vector<const DexFile*>& dex_files) { - size_t failure_count = 0; +static void OpenDexFiles(const std::vector<const char*>& dex_filenames, + const std::vector<const char*>& dex_locations, + std::vector<const DexFile*>& dex_files) { for (size_t i = 0; i < dex_filenames.size(); i++) { const char* dex_filename = dex_filenames[i]; const char* dex_location = dex_locations[i]; @@ -430,12 +429,10 @@ static size_t OpenDexFiles(const std::vector<const char*>& dex_filenames, const DexFile* dex_file = DexFile::Open(dex_filename, dex_location, &error_msg); if (dex_file == NULL) { LOG(WARNING) << "Failed to open .dex from file '" << dex_filename << "': " << error_msg; - ++failure_count; } else { dex_files.push_back(dex_file); } } - return failure_count; } // The primary goal of the watchdog is to prevent stuck build servers @@ -895,11 +892,7 @@ static int dex2oat(int argc, char** argv) { options.push_back(std::make_pair("compiler", reinterpret_cast<void*>(NULL))); std::vector<const DexFile*> boot_class_path; if (boot_image_option.empty()) { - size_t failure_count = OpenDexFiles(dex_filenames, dex_locations, boot_class_path); - if (failure_count > 0) { - LOG(ERROR) << "Failed to open some dex files: " << failure_count; - return EXIT_FAILURE; - } + OpenDexFiles(dex_filenames, dex_locations, boot_class_path); options.push_back(std::make_pair("bootclasspath", &boot_class_path)); } else { options.push_back(std::make_pair(boot_image_option.c_str(), reinterpret_cast<void*>(NULL))); @@ -971,11 +964,7 @@ static int dex2oat(int argc, char** argv) { } dex_files.push_back(dex_file); } else { - size_t failure_count = OpenDexFiles(dex_filenames, dex_locations, dex_files); - if (failure_count > 0) { - LOG(ERROR) << "Failed to open some dex files: " << failure_count; - return EXIT_FAILURE; - } + OpenDexFiles(dex_filenames, dex_locations, dex_files); } // Ensure opened dex files are writable for dex-to-dex transformations. |