From: Mathieu Desnoyers Date: Tue, 6 Mar 2012 23:10:43 +0000 (-0500) Subject: Fix: recvmsg should handle EINTR X-Git-Tag: v2.0.0-rc3~10 X-Git-Url: http://git.lttng.org/?p=lttng-ust.git;a=commitdiff_plain;h=7e3cfcbe9ccfef8837c42efcf5332035814415fc Fix: recvmsg should handle EINTR Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust-comm/lttng-ust-comm.c b/liblttng-ust-comm/lttng-ust-comm.c index 3277191c..21f48ed0 100644 --- a/liblttng-ust-comm/lttng-ust-comm.c +++ b/liblttng-ust-comm/lttng-ust-comm.c @@ -248,7 +248,9 @@ ssize_t ustcomm_recv_unix_sock(int sock, void *buf, size_t len) msg.msg_iov = iov; msg.msg_iovlen = 1; - ret = recvmsg(sock, &msg, 0); + do { + ret = recvmsg(sock, &msg, 0); + } while (ret < 0 && errno == EINTR); if (ret < 0) { perror("recvmsg"); } @@ -462,7 +464,10 @@ int ustcomm_recv_fd(int sock) msg.msg_control = recv_fd; msg.msg_controllen = sizeof(recv_fd); - if ((ret = recvmsg(sock, &msg, 0)) < 0) { + do { + ret = recvmsg(sock, &msg, 0); + } while (ret < 0 && errno == EINTR); + if (ret < 0) { perror("recvmsg"); goto end; }