From: David Goulet Date: Tue, 20 Mar 2012 18:33:23 +0000 (-0400) Subject: Fix: handle EINTR for sendmsg syscall X-Git-Tag: v2.0.0-rc4~14 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=66724ea3b246d624c49a499f4faf93b12c2d1e0f;p=lttng-tools.git Fix: handle EINTR for sendmsg syscall (close #170) Signed-off-by: David Goulet --- diff --git a/src/common/sessiond-comm/sessiond-comm.c b/src/common/sessiond-comm/sessiond-comm.c index 89ea207e0..f396c42f3 100644 --- a/src/common/sessiond-comm/sessiond-comm.c +++ b/src/common/sessiond-comm/sessiond-comm.c @@ -368,7 +368,9 @@ ssize_t lttcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd) msg.msg_iov = iov; msg.msg_iovlen = 1; - ret = sendmsg(sock, &msg, 0); + do { + ret = sendmsg(sock, &msg, 0); + } while (ret < 0 && errno == EINTR); if (ret < 0) { /* * Only warn about EPIPE when quiet mode is deactivated. @@ -489,7 +491,9 @@ ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len) LTTNG_SOCK_SET_PID_CRED(creds, getpid()); #endif /* __linux__ */ - ret = sendmsg(sock, &msg, 0); + do { + ret = sendmsg(sock, &msg, 0); + } while (ret < 0 && errno == EINTR); if (ret < 0) { /* * Only warn about EPIPE when quiet mode is deactivated.