New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msg/simple/Pipe:the returned value for do_recv unequal to zero #10272

Merged
merged 1 commit into from Mar 13, 2017

Conversation

Projects
None yet
4 participants
@yonghengdexin735
Contributor

yonghengdexin735 commented Jul 13, 2016

the returned value for do_recv unequal to zero:

ssize_t Pipe::do_recv(char *buf, size_t len, int flags)
{
again:
  ssize_t got = ::recv( sd, buf, len, flags );
  if (got < 0) {
    if (errno == EINTR) {
      goto again;
    }
    ldout(msgr->cct, 10) << **func** << " socket " << sd << " returned "
             << got << " " << cpp_strerror(errno) << dendl;
    return -1;
  }
  if (got == 0) {
    return -1;
  }
  return got;
}

so here '=' can be removed
Signed-off-by: zhang.zezhu zhang.zezhu@zte.com.cn

@gregsfortytwo

This comment has been minimized.

Member

gregsfortytwo commented Jul 13, 2016

Is do_recv() not returning 0 really part of the defined interface, or just a current implementation? I guess we can merge this on the first but the <= doesn't cost any more than < and changing it reduces resiliency to future changes...

@gregsfortytwo gregsfortytwo added the core label Jul 13, 2016

@ghost

This comment has been minimized.

ghost commented Nov 21, 2016

jenkins test this please (jenkins stuck)

@yonghengdexin735

This comment has been minimized.

Contributor

yonghengdexin735 commented Nov 23, 2016

@dachary done

@ghost ghost added the cleanup label Nov 23, 2016

@ghost

This comment has been minimized.

ghost commented Nov 23, 2016

@yonghengdexin735 you need to update the commit message, it won't work if you update the github web interface message

msg/simple/Pipe:the returned value for do_recv unequal to zero
the returned value for do_recv unequal to zero:

ssize_t Pipe::do_recv(char *buf, size_t len, int flags)
{
again:
  ssize_t got = ::recv( sd, buf, len, flags );
  if (got < 0) {
    if (errno == EINTR) {
      goto again;
    }
    ldout(msgr->cct, 10) << **func** << " socket " << sd << " returned "
             << got << " " << cpp_strerror(errno) << dendl;
    return -1;
  }
  if (got == 0) {
    return -1;
  }
  return got;
}

so here '=' can be removed

Signed-off-by: zhang.zezhu <zhang.zezhu@zte.com.cn>
@yonghengdexin735

This comment has been minimized.

Contributor

yonghengdexin735 commented Nov 24, 2016

@dachary Thank you for review.Done it.

@ghost

This comment has been minimized.

ghost commented Nov 24, 2016

jenkins test this please (cephtool-test-mds.sh http://tracker.ceph.com/issues/18016)

@tchaikov tchaikov added the needs-qa label Mar 7, 2017

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Mar 7, 2017

i think it's more consistent with the other caller site of do_recv() in Pipe::buffered_recv(). so lgtm.

@yuriw yuriw merged commit b198061 into ceph:master Mar 13, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment