diff options
| author | 2014-09-16 06:58:35 +0000 | |
|---|---|---|
| committer | 2014-09-16 06:58:35 +0000 | |
| commit | ed6839d7df3c668fa138c461cd657bcb32a43a7f (patch) | |
| tree | c6128ea7b6d2472a8281488a6842cc9d155b066b | |
| parent | 20ffc8757277dac7fd7a74e576c6185ae1292285 (diff) | |
| parent | 9ef2b6c73b964754fbb9198b1e3ea3d56744a059 (diff) | |
Merge "ART: Do not unlink unreadable ELF files"
| -rw-r--r-- | runtime/oat_file.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc index 7375428ef1..c621e88111 100644 --- a/runtime/oat_file.cc +++ b/runtime/oat_file.cc @@ -93,13 +93,9 @@ OatFile* OatFile::Open(const std::string& filename, } ret.reset(OpenElfFile(file.get(), location, requested_base, false, executable, error_msg)); - // Opening the file failed. Try to delete it and maybe we have more luck after it gets - // regenerated. - if (ret.get() == nullptr) { - LOG(WARNING) << "Attempting to unlink oat file " << filename << " that could not be opened. " - << "Error was: " << error_msg; - unlink(file->GetPath().c_str()); // Try to remove the file. - } + // It would be nice to unlink here. But we might have opened the file created by the + // ScopedLock, which we better not delete to avoid races. TODO: Investigate how to fix the API + // to allow removal when we know the ELF must be borked. } return ret.release(); } |