summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/jni/android_os_Debug.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index eb55a9309d28..14dbabb1ce02 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -717,7 +717,11 @@ static bool dumpTraces(JNIEnv* env, jint pid, jstring fileName, jint timeoutSecs
return false;
}
- return (dump_backtrace_to_file_timeout(pid, dumpType, timeoutSecs, fd) == 0);
+ int res = dump_backtrace_to_file_timeout(pid, dumpType, timeoutSecs, fd);
+ if (fdatasync(fd.get()) != 0) {
+ PLOG(ERROR) << "Failed flushing trace.";
+ }
+ return res == 0;
}
static jboolean android_os_Debug_dumpJavaBacktraceToFileTimeout(JNIEnv* env, jobject clazz,