From 66724ea3b246d624c49a499f4faf93b12c2d1e0f Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 20 Mar 2012 14:33:23 -0400 Subject: [PATCH] Fix: handle EINTR for sendmsg syscall (close #170) Signed-off-by: David Goulet --- src/common/sessiond-comm/sessiond-comm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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. -- 2.34.1