projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: sendmsg EPIPE should be quiet by default (expected)
[lttng-tools.git]
/
src
/
common
/
sessiond-comm
/
sessiond-comm.c
diff --git
a/src/common/sessiond-comm/sessiond-comm.c
b/src/common/sessiond-comm/sessiond-comm.c
index 8a5ff1d3f10520efb26bef784dc7847fd7fba033..477bd1c644ca18a6d87bde40212e46678a3db0b1 100644
(file)
--- a/
src/common/sessiond-comm/sessiond-comm.c
+++ b/
src/common/sessiond-comm/sessiond-comm.c
@@
-292,7
+292,13
@@
ssize_t lttcomm_send_unix_sock(int sock, void *buf, size_t len)
ret = sendmsg(sock, &msg, 0);
if (ret < 0) {
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;
}
return ret;
@@
-357,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) {
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;
}
}
return ret;
}
@@
-466,9
+478,14
@@
ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len)
ret = sendmsg(sock, &msg, 0);
if (ret < 0) {
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;
}
return ret;
}
This page took
0.023568 seconds
and
4
git commands to generate.