From bd48280290515620c29337961eb511a6eb9f8824 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 16 Oct 2018 17:20:11 +0000 Subject: [PATCH] util: close keys file lock on exec --- src/common/util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/util.cpp b/src/common/util.cpp index 2a1d49af0..7d8c9aa99 100644 --- a/src/common/util.cpp +++ b/src/common/util.cpp @@ -233,7 +233,7 @@ namespace tools MERROR("Failed to open " << filename << ": " << std::error_code(GetLastError(), std::system_category())); } #else - m_fd = open(filename.c_str(), O_RDONLY | O_CREAT, 0666); + m_fd = open(filename.c_str(), O_RDONLY | O_CREAT | O_CLOEXEC, 0666); if (m_fd != -1) { if (flock(m_fd, LOCK_EX | LOCK_NB) == -1)