Add flock(2)ing on dex-cache files to prevent races
Bug: 9071417
Change-Id: I1ee9ff281867f90fba7a8ed8bbf06b33ac29d511
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 67398af..fbfdfd9 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -777,7 +777,7 @@
os_ = saved_os;
}
os << "STATS:\n" << std::flush;
- UniquePtr<File> file(OS::OpenFile(image_filename_.c_str(), false));
+ UniquePtr<File> file(OS::OpenFileForReading(image_filename_.c_str()));
stats_.file_bytes = file->GetLength();
size_t header_bytes = sizeof(ImageHeader);
stats_.header_bytes = header_bytes;