From: David Goulet Date: Tue, 24 Jan 2012 15:17:30 +0000 (-0500) Subject: Add MSG_WAITALL to recvmsg of sessiond-comm X-Git-Tag: v2.0-pre19~62 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=8266852eb71adbd61c13655dd1afdf6bffe2da6c;hp=4466912fc280873b6432973b287a48bf9c959b6c Add MSG_WAITALL to recvmsg of sessiond-comm Get the complete message on receive. We do not handle receiving split data with the lttcomm_recv_unix_sock which is *not* good but for now we will simply add this flag since every call should block anyway and does not require any other funky flags. This issue was detected with the kernel events listing failing by sending half of the data half the time. Reported-by: Daniel Thibault Signed-off-by: David Goulet --- diff --git a/src/common/sessiond-comm/sessiond-comm.c b/src/common/sessiond-comm/sessiond-comm.c index 3b7a2a2ad..591e9629a 100644 --- a/src/common/sessiond-comm/sessiond-comm.c +++ b/src/common/sessiond-comm/sessiond-comm.c @@ -258,7 +258,7 @@ ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len) msg.msg_iov = iov; msg.msg_iovlen = 1; - ret = recvmsg(sock, &msg, 0); + ret = recvmsg(sock, &msg, MSG_WAITALL); if (ret < 0) { perror("recvmsg"); }