> On Sept. 29, 2015, 12:47 a.m., Ben Mahler wrote:
> > 3rdparty/libprocess/src/socket.cpp, lines 42-44
> > <https://reviews.apache.org/r/38809/diff/2/?file=1086106#file1086106line42>
> >
> > Just as an aside, it's unfortunate the caller has to do this, we should consider
doing the same thing that is done in os/posix/open.hpp with O_CLOEXEC:
> >
> > https://github.com/apache/mesos/blob/5aa050bfaa7338b010b1a522406bde0f15015259/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/open.hpp#L33
>
> Chi Zhang wrote:
> I actually think this is not too bad -- a very staightforward if-else.
>
> I can probably break it up and save one network::socket call -- not sure if that's
worth the added complexity, but I can do it in another patch if you'd like to see that?
>
> Ben Mahler wrote:
> No don't do it right now, just an aside. While it's straightforward here, every user
of network::socket is going to have this #ifdef which complicates the calling code, it got
out of hand for os::open which is why we provided O_CLOEXEC for all platforms.
okay, you meant pushing all this into network::socket. Yeah that makes sense.
- Chi
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38809/#review100909
-----------------------------------------------------------
On Sept. 29, 2015, 8:30 p.m., Chi Zhang wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38809/
> -----------------------------------------------------------
>
> (Updated Sept. 29, 2015, 8:30 p.m.)
>
>
> Review request for mesos and Ben Mahler.
>
>
> Bugs: MESOS-3519
> https://issues.apache.org/jira/browse/MESOS-3519
>
>
> Repository: mesos
>
>
> Description
> -------
>
> socket: refactor to use Option and fix file descriptor leaks.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/socket.hpp 817cb37
> 3rdparty/libprocess/src/socket.cpp 5879423
>
> Diff: https://reviews.apache.org/r/38809/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Chi Zhang
>
>
|