ART: Fix android-cloexec warnings
Use the DupCloexec helper wherever possible. Add O_CLOEXEC to open
and fopen calls.
Bug: 32619234
Test: WITH_TIDY=1 mmma art
Change-Id: I0afb1beea53ab8f68ab85d1762aff999903060fe
diff --git a/libartbase/base/common_art_test.cc b/libartbase/base/common_art_test.cc
index 9485fca..987ceb6 100644
--- a/libartbase/base/common_art_test.cc
+++ b/libartbase/base/common_art_test.cc
@@ -62,7 +62,7 @@
: ScratchFile(other.GetFilename() + suffix) {}
ScratchFile::ScratchFile(const std::string& filename) : filename_(filename) {
- int fd = open(filename_.c_str(), O_RDWR | O_CREAT, 0666);
+ int fd = open(filename_.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0666);
CHECK_NE(-1, fd);
file_.reset(new File(fd, GetFilename(), true));
}