https://breakpad.appspot.com/421002/diff/2001/src/client/linux/crash_generati...
File src/client/linux/crash_generation/crash_generation_client.cc (right):
https://breakpad.appspot.com/421002/diff/2001/src/client/linux/crash_generati...
src/client/linux/crash_generation/crash_generation_client.cc:71: bool ret =
HANDLE_EINTR(sys_sendmsg(server_fd_, &msg, 0));
On 2012/07/23 22:03:16, Mark Mentovai wrote:
> bool here and <= 0 two lines later? Is that really the pattern you want to
use?
> That’s infuriatingly obtuse.
Do you prefer this instead? I don't have strong feelings either way.
if (foo <= 0) {
sys_close(fds[1]);
return false;
}
sys_close(fds[1]);
Is there another alternative pattern that I'm forgetting?
https://breakpad.appspot.com/421002/diff/2001/src/client/linux/crash_generati...
File src/client/linux/crash_generation/crash_generation_client.cc (right):
https://breakpad.appspot.com/421002/diff/2001/src/client/linux/crash_generati...
src/client/linux/crash_generation/crash_generation_client.cc:71: bool ret =
HANDLE_EINTR(sys_sendmsg(server_fd_, &msg, 0));
thestig wrote:
> On 2012/07/23 22:03:16, Mark Mentovai wrote:
> > bool here and <= 0 two lines later? Is that really the pattern you want to
> use?
> > That’s infuriatingly obtuse.
>
> Do you prefer this instead? I don't have strong feelings either way.
>
> if (foo <= 0) {
> sys_close(fds[1]);
> return false;
> }
> sys_close(fds[1]);
>
> Is there another alternative pattern that I'm forgetting?
I meant…
is bool really the return type of sys_sendmsg?
and
why are you testing a_bool <= 0?
https://breakpad.appspot.com/421002/diff/2001/src/client/linux/crash_generati...
File src/client/linux/crash_generation/crash_generation_client.cc (right):
https://breakpad.appspot.com/421002/diff/2001/src/client/linux/crash_generati...
src/client/linux/crash_generation/crash_generation_client.cc:71: bool ret =
HANDLE_EINTR(sys_sendmsg(server_fd_, &msg, 0));
On 2012/07/23 22:31:06, Mark Mentovai wrote:
> thestig wrote:
> > On 2012/07/23 22:03:16, Mark Mentovai wrote:
> > > bool here and <= 0 two lines later? Is that really the pattern you want to
> > use?
> > > That’s infuriatingly obtuse.
> >
> > Do you prefer this instead? I don't have strong feelings either way.
> >
> > if (foo <= 0) {
> > sys_close(fds[1]);
> > return false;
> > }
> > sys_close(fds[1]);
> >
> > Is there another alternative pattern that I'm forgetting?
>
> I meant…
>
> is bool really the return type of sys_sendmsg?
>
> and
>
> why are you testing a_bool <= 0?
Clearly a case of the Mondays. s/bool/ssize_t/
https://breakpad.appspot.com/421002/diff/6002/src/common/linux/ignore_ret.h File src/common/linux/ignore_ret.h (right): https://breakpad.appspot.com/421002/diff/6002/src/common/linux/ignore_ret.h#newcode34 src/common/linux/ignore_ret.h:34: // where we either a) know the call cannot ...
Issue 421002: Linux: Fix a bunch of clang errors from not handling return values.
(Closed)
Created 12 years, 4 months ago by Lei Zhang (chromium)
Modified 12 years, 4 months ago
Reviewers: Mark Mentovai
Base URL: http://google-breakpad.googlecode.com/svn/trunk/
Comments: 11