X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Fsessiond-comm.c;h=96615f4389adad78ac3804a9cd9c1b1dba7a763a;hp=aa24e82ddff31d80f6d0d15fe969aca8dc80f49e;hb=ca2eb7f43cf00d12f563905d741a6789c3d130ee;hpb=52b07d8a5f38946bea3176d486c1934ca7639415 diff --git a/src/common/sessiond-comm/sessiond-comm.c b/src/common/sessiond-comm/sessiond-comm.c index aa24e82dd..96615f438 100644 --- a/src/common/sessiond-comm/sessiond-comm.c +++ b/src/common/sessiond-comm/sessiond-comm.c @@ -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; }