msg/simple/Pipe: avoid infinite loop in Pipe::do_recv()
Reviewed-by: Haomai Wang <haomai@xsky.com>
return 0;
}
-int Pipe::do_recv(char *buf, size_t len, int flags)
+ssize_t Pipe::do_recv(char *buf, size_t len, int flags)
{
again:
- int got = ::recv( sd, buf, len, flags );
+ ssize_t got = ::recv( sd, buf, len, flags );
if (got < 0) {
- if (errno == EAGAIN || errno == EINTR) {
+ if (errno == EINTR) {
goto again;
}
ldout(msgr->cct, 10) << __func__ << " socket " << sd << " returned "