From b5eaa66e68b22f0e4cae96db8ef0bc2d12d14ed4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 13 Feb 2020 18:21:08 -0500 Subject: [PATCH] Fix: unix: don't PERROR on EAGAIN for non-blocking sockets MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/unix.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/common/unix.c b/src/common/unix.c index d37313c5a..15c317466 100644 --- a/src/common/unix.c +++ b/src/common/unix.c @@ -242,12 +242,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; @@ -330,12 +327,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; -- 2.34.1