Merge "trace-dev.c: more O_CLOEXEC"

am: a8d3fdf4c6

* commit 'a8d3fdf4c62b485073b439ed46b4814f1608f77a':
  trace-dev.c: more O_CLOEXEC
This commit is contained in:
Nick Kralevich 2015-12-16 21:50:01 +00:00 committed by android-build-merger
commit 2dda6ac98d

View file

@ -104,7 +104,7 @@ static bool atrace_is_app_tracing_enabled()
if (sys_debuggable || atrace_is_debuggable) {
// Check whether tracing is enabled for this process.
FILE * file = fopen("/proc/self/cmdline", "r");
FILE * file = fopen("/proc/self/cmdline", "re");
if (file) {
char cmdline[4096];
if (fgets(cmdline, sizeof(cmdline), file)) {
@ -173,7 +173,7 @@ void atrace_update_tags()
static void atrace_init_once()
{
atrace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_WRONLY);
atrace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_WRONLY | O_CLOEXEC);
if (atrace_marker_fd == -1) {
ALOGE("Error opening trace file: %s (%d)", strerror(errno), errno);
atrace_enabled_tags = 0;