X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Finet.c;h=e0b3e7a96ffb1d13324ae0bbb9f7b58238df93be;hp=e48f2c9ad8195d7cf90bc76d48715e414a6d6d26;hb=5312a3edd938117cb5670de711f237e7b6f2e68c;hpb=2288467f63826a06d25ac361fa04ea92ec7ddfa3 diff --git a/src/common/sessiond-comm/inet.c b/src/common/sessiond-comm/inet.c index e48f2c9ad..e0b3e7a96 100644 --- a/src/common/sessiond-comm/inet.c +++ b/src/common/sessiond-comm/inet.c @@ -384,18 +384,22 @@ ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf, len_last = iov[0].iov_len; ret = recvmsg(sock->fd, &msg, flags); if (ret > 0) { + if (flags & MSG_DONTWAIT) { + goto end; + } iov[0].iov_base += ret; iov[0].iov_len -= ret; assert(ret <= len_last); } } while ((ret > 0 && ret < len_last) || (ret < 0 && errno == EINTR)); + if (ret < 0) { PERROR("recvmsg inet"); } else if (ret > 0) { ret = len; } /* Else ret = 0 meaning an orderly shutdown. */ - +end: return ret; }