diff options
author | 2018-10-16 20:22:37 -0700 | |
---|---|---|
committer | 2018-10-19 13:06:33 -0700 | |
commit | dfcd82c09e8ce4562ed39e006d4b1c8163b4e25e (patch) | |
tree | d9bfd3e043a95b3c8e302769cef23c13a89df3c5 /runtime/oat_file_assistant_test.cc | |
parent | 4f570a43146c1456071f2ffe6590ab96e723051a (diff) |
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
Diffstat (limited to 'runtime/oat_file_assistant_test.cc')
-rw-r--r-- | runtime/oat_file_assistant_test.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/oat_file_assistant_test.cc b/runtime/oat_file_assistant_test.cc index 3a974df386..aba2eaeb69 100644 --- a/runtime/oat_file_assistant_test.cc +++ b/runtime/oat_file_assistant_test.cc @@ -338,9 +338,9 @@ TEST_F(OatFileAssistantTest, GetDexOptNeededWithFd) { CompilerFilter::kSpeed, /* with_alternate_image */ false); - android::base::unique_fd odex_fd(open(odex_location.c_str(), O_RDONLY)); - android::base::unique_fd vdex_fd(open(vdex_location.c_str(), O_RDONLY)); - android::base::unique_fd zip_fd(open(dex_location.c_str(), O_RDONLY)); + android::base::unique_fd odex_fd(open(odex_location.c_str(), O_RDONLY | O_CLOEXEC)); + android::base::unique_fd vdex_fd(open(vdex_location.c_str(), O_RDONLY | O_CLOEXEC)); + android::base::unique_fd zip_fd(open(dex_location.c_str(), O_RDONLY | O_CLOEXEC)); OatFileAssistant oat_file_assistant(dex_location.c_str(), kRuntimeISA, @@ -377,8 +377,8 @@ TEST_F(OatFileAssistantTest, GetDexOptNeededWithInvalidOdexFd) { CompilerFilter::kSpeed, /* with_alternate_image */ false); - android::base::unique_fd vdex_fd(open(vdex_location.c_str(), O_RDONLY)); - android::base::unique_fd zip_fd(open(dex_location.c_str(), O_RDONLY)); + android::base::unique_fd vdex_fd(open(vdex_location.c_str(), O_RDONLY | O_CLOEXEC)); + android::base::unique_fd zip_fd(open(dex_location.c_str(), O_RDONLY | O_CLOEXEC)); OatFileAssistant oat_file_assistant(dex_location.c_str(), kRuntimeISA, @@ -410,8 +410,8 @@ TEST_F(OatFileAssistantTest, GetDexOptNeededWithInvalidVdexFd) { CompilerFilter::kSpeed, /* with_alternate_image */ false); - android::base::unique_fd odex_fd(open(odex_location.c_str(), O_RDONLY)); - android::base::unique_fd zip_fd(open(dex_location.c_str(), O_RDONLY)); + android::base::unique_fd odex_fd(open(odex_location.c_str(), O_RDONLY | O_CLOEXEC)); + android::base::unique_fd zip_fd(open(dex_location.c_str(), O_RDONLY | O_CLOEXEC)); OatFileAssistant oat_file_assistant(dex_location.c_str(), kRuntimeISA, @@ -436,7 +436,7 @@ TEST_F(OatFileAssistantTest, GetDexOptNeededWithInvalidOdexVdexFd) { Copy(GetDexSrc1(), dex_location); - android::base::unique_fd zip_fd(open(dex_location.c_str(), O_RDONLY)); + android::base::unique_fd zip_fd(open(dex_location.c_str(), O_RDONLY | O_CLOEXEC)); OatFileAssistant oat_file_assistant(dex_location.c_str(), kRuntimeISA, false, |