Fix: unix: don't PERROR on EAGAIN for non-blocking sockets
[lttng-tools.git] / src / common / unix.c
index d37313c5aed87ee6600b1953ce6ba84a97d6f660..15c31746638e8b1c811c9f00c56e106cbc12024f 100644 (file)
@@ -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;
This page took 0.024703 seconds and 4 git commands to generate.