Remove inappropriate \n from easy-ust sample
[lttng-ust.git] / liblttng-ust-comm / lttng-ust-comm.c
index 0781f4cecb4408f0746d8e1f3586f740d09aae4a..2332dbf1a383d2b2b6e1500fb604039e53ab72e9 100644 (file)
@@ -284,7 +284,9 @@ ssize_t ustcomm_send_unix_sock(int sock, void *buf, size_t len)
         * by ignoring SIGPIPE, but we don't have this luxury on the
         * libust side.
         */
-       ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+       do {
+               ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+       } while (ret < 0 && errno == EINTR);
        if (ret < 0 && errno != EPIPE) {
                perror("sendmsg");
        }
@@ -301,10 +303,9 @@ int ustcomm_close_unix_sock(int sock)
 {
        int ret;
 
-       /* Shutdown receptions and transmissions */
-       ret = shutdown(sock, SHUT_RDWR);
+       ret = close(sock);
        if (ret < 0) {
-               perror("shutdown");
+               perror("close");
        }
 
        return ret;
@@ -348,7 +349,9 @@ ssize_t ustcomm_send_fds_unix_sock(int sock, void *buf, int *fds, size_t nb_fd,
        msg.msg_iov = iov;
        msg.msg_iovlen = 1;
 
-       ret = sendmsg(sock, &msg, 0);
+       do {
+               ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+       } while (ret < 0 && errno == EINTR);
        if (ret < 0 && errno != EPIPE) {
                perror("sendmsg");
        }
This page took 0.023415 seconds and 4 git commands to generate.