From: Jérémie Galarneau Date: Thu, 13 Feb 2020 23:21:08 +0000 (-0500) Subject: Fix: unix: don't PERROR on EAGAIN for non-blocking sockets X-Git-Tag: v2.12.2~35 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;ds=sidebyside;h=6a1a7afd437b7699a41a716a05b33f22b237aec4;p=lttng-tools.git Fix: unix: don't PERROR on EAGAIN for non-blocking sockets EAGAIN is expected on non-blocking UNIX socket operations. This results in a spammy sessiond log. Signed-off-by: Jérémie Galarneau Change-Id: I58ba711dad193b8d6849501f3e090797813e18ac Depends-on: lttng-ust: I5a800fc92e588c2a6a0e26282b0ad5f31c044479 --- diff --git a/src/common/unix.c b/src/common/unix.c index 222b4a3d9..26eda52d9 100644 --- a/src/common/unix.c +++ b/src/common/unix.c @@ -232,12 +232,9 @@ retry: if (errno == EINTR) { goto retry; } else { - /* - * Only warn about EPIPE when quiet mode is - * deactivated. - * We consider EPIPE as expected. - */ - if (errno != EPIPE || !lttng_opt_quiet) { + /* We consider EPIPE and EAGAIN as expected. */ + if (!lttng_opt_quiet && + (errno != EPIPE && errno != EAGAIN)) { PERROR("recvmsg"); } goto end; @@ -320,12 +317,9 @@ retry: if (errno == EINTR) { goto retry; } else { - /* - * Only warn about EPIPE when quiet mode is - * deactivated. - * We consider EPIPE as expected. - */ - if (errno != EPIPE || !lttng_opt_quiet) { + /* We consider EPIPE and EAGAIN as expected. */ + if (!lttng_opt_quiet && + (errno != EPIPE && errno != EAGAIN)) { PERROR("sendmsg"); } goto end;