From b5b162e2048ac3294713bed975250ecae7bf2389 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Wed, 26 Feb 2020 10:29:04 -0800 Subject: [PATCH] logwrap: add missing O_CLOEXEC Bug: 150260863 Test: build Change-Id: Ibe070d5d4f3a7ada0718f74c7cee12db7b9f920e --- logwrapper/logwrap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logwrapper/logwrap.cpp b/logwrapper/logwrap.cpp index 5337801e3..5a518bc56 100644 --- a/logwrapper/logwrap.cpp +++ b/logwrapper/logwrap.cpp @@ -374,7 +374,7 @@ static int parent(const char* tag, int parent_read, pid_t pid, int* chld_sts, in } if (log_target & LOG_FILE) { - fd = open(file_path, O_WRONLY | O_CREAT, 0664); + fd = open(file_path, O_WRONLY | O_CREAT | O_CLOEXEC, 0664); if (fd < 0) { ERROR("Cannot log to file %s\n", file_path); log_target &= ~LOG_FILE;