summaryrefslogtreecommitdiff
path: root/runtime/native/dalvik_system_VMDebug.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2018-10-16 20:22:37 -0700
committer Andreas Gampe <agampe@google.com> 2018-10-19 13:06:33 -0700
commitdfcd82c09e8ce4562ed39e006d4b1c8163b4e25e (patch)
treed9bfd3e043a95b3c8e302769cef23c13a89df3c5 /runtime/native/dalvik_system_VMDebug.cc
parent4f570a43146c1456071f2ffe6590ab96e723051a (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/native/dalvik_system_VMDebug.cc')
-rw-r--r--runtime/native/dalvik_system_VMDebug.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc
index 6f98a6d381..96f15ded2a 100644
--- a/runtime/native/dalvik_system_VMDebug.cc
+++ b/runtime/native/dalvik_system_VMDebug.cc
@@ -23,6 +23,7 @@
#include "nativehelper/jni_macros.h"
+#include "base/file_utils.h"
#include "base/histogram-inl.h"
#include "base/time_utils.h"
#include "class_linker.h"
@@ -113,7 +114,7 @@ static void VMDebug_startMethodTracingFd(JNIEnv* env,
return;
}
- int fd = dup(originalFd);
+ int fd = DupCloexec(originalFd);
if (fd < 0) {
ScopedObjectAccess soa(env);
soa.Self()->ThrowNewExceptionF("Ljava/lang/RuntimeException;",