> On Aug. 27, 2013, 7:31 p.m., Ben Mahler wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/os/sendfile.hpp, lines 
> > 29-34
> > <https://reviews.apache.org/r/13840/diff/1/?file=345051#file345051line29>
> >
> >     How about the following so that we can avoid needing to assert:
> >     
> >     ssize_t result;
> >     
> >     suppress (SIGPIPE) {
> >       // This will set errno to EPIPE if a SIGPIPE occurs.
> >       result = ::sendfile(s, fd, &offset, length);
> >     }
> >     
> >     return result;
> 
> Vinson Lee wrote:
>     The return value will still be undefined if suppress(SIGPIPE) fails.

suppress is a macro that guarantees the code in the suppressed scope will be 
executed.

I agree that we should guard against a regression but I'm concerned about using 
assert because it can be disabled. Can you use fatal (from fatal.hpp)?


- Ben


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/13840/#review25632
-----------------------------------------------------------


On Aug. 27, 2013, 5:11 a.m., Vinson Lee wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/13840/
> -----------------------------------------------------------
> 
> (Updated Aug. 27, 2013, 5:11 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Ben Mahler, Chi Zhang, Eric 
> Biederman, Ian Downes, and David Mackey.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Author: Vinson Lee <[email protected]>
> 
> stout: Fix clang return-type build error.
> 
> This patch fixes this build error with clang.
> 
> In file included from sched/sched.cpp:35:
> In file included from ../3rdparty/libprocess/include/process/delay.hpp:6:
> In file included from ../3rdparty/libprocess/include/process/dispatch.hpp:9:
> In file included from ../3rdparty/libprocess/include/process/process.hpp:13:
> In file included from ../3rdparty/libprocess/include/process/event.hpp:10:
> In file included from ../3rdparty/libprocess/include/process/socket.hpp:10:
> In file included from 
> ../3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp:65:
> ../3rdparty/libprocess/3rdparty/stout/include/stout/os/sendfile.hpp:46:1: 
> error: control may reach end of non-void function [-Werror,-Wreturn-type]
> }
> ^
> 
> Signed-off-by: Vinson Lee <[email protected]>
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/sendfile.hpp b41ba63 
> 
> Diff: https://reviews.apache.org/r/13840/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Vinson Lee
> 
>

Reply via email to