[Lldb-commits] [PATCH] Apply SOCK_CLOEXEC flag to socket API functions in order to avoid handle leakage to a forked child process.

Zachary Turner zturner at google.com
Tue Nov 11 15:28:46 PST 2014


================
Comment at: include/lldb/Host/Socket.h:51
@@ -50,1 +50,3 @@
 
+    struct Options {
+      bool m_child_processes_inherit;
----------------
Can you fix the formatting here?  LLDB uses

struct Options
{
};

Alternatively, it seems a little unnecessary to have this struct for only one boolean variable.  You could just pass the option by value.  Even if more options are added in the future, it could probably just be turned into a bitmask

================
Comment at: source/Host/common/Socket.cpp:63
@@ +62,3 @@
+  auto socketType = type;
+  #ifdef SOCK_CLOEXEC
+  if (!opts.m_child_processes_inherit) {
----------------
I think the #ifdef should be aligned with column 0.  Same in the rest of them.

http://reviews.llvm.org/D6204






More information about the lldb-commits mailing list