Fix: handle EINTR for sendmsg syscall
authorDavid Goulet <dgoulet@efficios.com>
Tue, 20 Mar 2012 18:33:23 +0000 (14:33 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 20 Mar 2012 18:33:23 +0000 (14:33 -0400)
(close #170)

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/sessiond-comm/sessiond-comm.c

index 89ea207e0667ca519b7113afd54f933a688c7bd0..f396c42f3c4417499a4534af41523a56fd2a1d33 100644 (file)
@@ -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.
This page took 0.025805 seconds and 4 git commands to generate.