From 75fceae7003e217e16b04433831da7528ae56881 Mon Sep 17 00:00:00 2001 From: Adam Azarchs Date: Wed, 19 Sep 2018 16:29:00 -0700 Subject: Add O_CLOEXEC to open calls. This prevents file descriptors from leaking to child processes. When compiled for older (pre-2.6.23) kernels which lack support for O_CLOEXEC there is no change in behavior. With newer kernels, child processes will no longer inherit leveldb's file handles, which reduces the changes of accidentally corrupting the database. Fixes https://github.com/google/leveldb/issues/623 --- port/port_config.h.in | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'port') diff --git a/port/port_config.h.in b/port/port_config.h.in index d6a6d01..2127315 100644 --- a/port/port_config.h.in +++ b/port/port_config.h.in @@ -15,6 +15,11 @@ #cmakedefine01 HAVE_FULLFSYNC #endif // !defined(HAVE_FULLFSYNC) +// Define to 1 if you have a definition for O_CLOEXEC in . +#if !defined(HAVE_O_CLOEXEC) +#cmakedefine01 HAVE_O_CLOEXEC +#endif // !defined(HAVE_O_CLOEXEC) + // Define to 1 if you have Google CRC32C. #if !defined(HAVE_CRC32C) #cmakedefine01 HAVE_CRC32C -- cgit v1.2.1