- /* We consider EPIPE and EAGAIN as expected. */
- if (!lttng_opt_quiet &&
- (errno != EPIPE && errno != EAGAIN)) {
- PERROR("sendmsg");
+ /*
+ * We consider EPIPE and EAGAIN/EWOULDBLOCK as expected.
+ */
+ if (errno == EAGAIN || errno == EWOULDBLOCK ||
+ errno == EPIPE) {
+ /*
+ * This can happen in non blocking mode.
+ * Nothing was sent.
+ */
+ ret = 0;
+ goto end;