<div>I'm not sure it makes sense to put it on that constructor, because that constructor takes an fd which has already been opened, so there would be no way to set the flag on an already opened fd.</div><div><br></div><div>CFD has a default constructor though, it would probably make more sense on that, and leave it off of the fd constructor.<br></div><br><div class="gmail_quote">On Mon Nov 10 2014 at 8:03:39 PM Oleksiy Vyalov <<a href="mailto:ovyalov@google.com" target="_blank">ovyalov@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">>>! In D6204#10, @zturner wrote:<br>
> Can I also request that the variable *not* be called close_on_exec?.  It is<br>
> possible to implement an equivalent on Windows, but calling it close on<br>
> exec will be confusing to people on Windows.  Can we come up with a more<br>
> generic name?  On Windows this would be called "inherit handles", which to<br>
> me sounds like a better name than close on exec, but I may be biased.  Is<br>
> "inherit handles" confusing to people on non-Windows?<br>
><br>
> In other words, I'm proposing<br>
><br>
> virtual lldb::ConnectionStatus ConnectionFileDescriptor::<u></u>Conn<u></u>ect(const char<br>
> *s, Error *error_ptr, bool close_on_exec = true);<br>
><br>
> would become<br>
><br>
> virtual lldb::ConnectionStatus ConnectionFileDescriptor::<u></u>Conn<u></u>ect(const char<br>
> *s, Error *error_ptr, bool inherit_handles = false);<br>
<br>
It sounds good to me to call this variable inherit_handles in order to make it more platform-independent.<br>
As I can see ConnectionFileDescriptor::<u></u>Conn<u></u>ect is overrides pure method from Connection::Connect (const char *url, Error *error_ptr)  and I'm a bit reluctant to make such variable visible for Communication layer  - so, I'm thinking about extending  ConnectionFileDescriptor constructor in a way like this:<br>
<br>
ConnectionFileDescriptor(int fd, bool owns_fd, bool inherit_handles = false);<br>
<br>
In this case methods within ConnectionFileDescriptor::<u></u>Conn<u></u>ect (SocketListen, NamedSocketAccept, NamedSocketAccept, ConnectTCP, ConnectUDP) may use member field m_inherit_handles instead of taking additional argument.<br>
<br>
<a href="http://reviews.llvm.org/D6204" target="_blank">http://reviews.llvm.org/D6204</a><br>
<br>
<br>
</blockquote></div>