Merge branch 'master' of git://git.lttng.org/lttng-tools
[lttng-tools.git] / src / common / sessiond-comm / sessiond-comm.c
index aa24e82ddff31d80f6d0d15fe969aca8dc80f49e..96615f4389adad78ac3804a9cd9c1b1dba7a763a 100644 (file)
@@ -116,6 +116,7 @@ static const char *lttcomm_readable_code[] = {
        [ LTTCOMM_ERR_INDEX(CONSUMERD_SPLICE_ENOMEM) ] = "consumerd splice ENOMEM",
        [ LTTCOMM_ERR_INDEX(CONSUMERD_SPLICE_ESPIPE) ] = "consumerd splice ESPIPE",
        [ LTTCOMM_ERR_INDEX(LTTCOMM_NO_EVENT) ] = "Event not found",
+       [ LTTCOMM_ERR_INDEX(LTTCOMM_NEED_ROOT_SESSIOND) ] = "A root lttng-sessiond needs to be running, and client user part of the \"tracing\" group, to interact with kernel tracing",
 };
 
 /*
@@ -291,7 +292,13 @@ ssize_t lttcomm_send_unix_sock(int sock, void *buf, size_t len)
 
        ret = sendmsg(sock, &msg, 0);
        if (ret < 0) {
-               PERROR("sendmsg");
+               /*
+                * Only warn about EPIPE when quiet mode is deactivated.
+                * We consider EPIPE as expected.
+                */
+               if (errno != EPIPE || !opt_quiet) {
+                       PERROR("sendmsg");
+               }
        }
 
        return ret;
@@ -356,7 +363,13 @@ ssize_t lttcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd)
 
        ret = sendmsg(sock, &msg, 0);
        if (ret < 0) {
-               PERROR("sendmsg");
+               /*
+                * Only warn about EPIPE when quiet mode is deactivated.
+                * We consider EPIPE as expected.
+                */
+               if (errno != EPIPE || !opt_quiet) {
+                       PERROR("sendmsg");
+               }
        }
        return ret;
 }
@@ -469,9 +482,14 @@ ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len)
 
        ret = sendmsg(sock, &msg, 0);
        if (ret < 0) {
-               PERROR("sendmsg");
+               /*
+                * Only warn about EPIPE when quiet mode is deactivated.
+                * We consider EPIPE as expected.
+                */
+               if (errno != EPIPE || !opt_quiet) {
+                       PERROR("sendmsg");
+               }
        }
-
        return ret;
 }
 
This page took 0.032632 seconds and 4 git commands to generate.