Add mprotect helper function to MemMap class.
Change-Id: I3967b76301d339de987fb8e094adbde4ef18573d
diff --git a/src/dex_file.cc b/src/dex_file.cc
index f18b215..3ba671e 100644
--- a/src/dex_file.cc
+++ b/src/dex_file.cc
@@ -96,9 +96,7 @@
}
void DexFile::ChangePermissions(int prot) const {
- if (mprotect(mem_map_->Begin(), mem_map_->Size(), prot) != 0) {
- PLOG(FATAL) << "Failed to change dex file permissions to " << prot << " for " << GetLocation();
- }
+ mem_map_->Protect(prot);
}
const DexFile* DexFile::OpenFile(const std::string& filename,