X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Finet.c;h=57ffbe45c28ed1ae68bded38f4713f901a23deb1;hb=9bb5f1f8c4f1aeaca00ebbca40fc145dc4c7ee52;hp=ac450dbc8b31b9e394eac7062d326edefcc26748;hpb=2daf65025e0fe5c15179dc4bfb26f875e3d31a26;p=lttng-tools.git diff --git a/src/common/sessiond-comm/inet.c b/src/common/sessiond-comm/inet.c index ac450dbc8..57ffbe45c 100644 --- a/src/common/sessiond-comm/inet.c +++ b/src/common/sessiond-comm/inet.c @@ -381,6 +381,15 @@ ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf, } while ((ret > 0 && ret < len_last) || (ret < 0 && errno == EINTR)); if (ret < 0) { + if (errno == EAGAIN && flags & MSG_DONTWAIT) { + /* + * EAGAIN is expected in non-blocking mode and should + * not be reported as an error. Moreover, if no data + * was read, 0 must not be returned as it would be + * interpreted as an orderly shutdown of the socket. + */ + goto end; + } PERROR("recvmsg inet"); } else if (ret > 0) { ret = len;