Fix: don't print error in comm proto connect on ENOENT
[lttng-ust.git] / liblttng-ust-comm / lttng-ust-comm.c
index 3644a1628a7fc12af488f79764c11422cceb3d39..a666ab274b5f3a25af9f77f5cea779938d2da986 100644 (file)
@@ -116,11 +116,14 @@ int ustcomm_connect_unix_sock(const char *pathname)
        ret = connect(fd, (struct sockaddr *) &sun, sizeof(sun));
        if (ret < 0) {
                /*
-                * Don't print message on connect error, because connect
-                * is used in normal execution to detect if sessiond is
-                * alive.
+                * Don't print message on connect ENOENT error, because
+                * connect is used in normal execution to detect if
+                * sessiond is alive. ENOENT is when the unix socket
+                * file does not exist, and ECONNREFUSED is when the
+                * file exists but no sessiond is listening.
                 */
-               if (errno != ECONNREFUSED && errno != ECONNRESET)
+               if (errno != ECONNREFUSED && errno != ECONNRESET
+                               && errno != ENOENT)
                        PERROR("connect");
                ret = -errno;
                if (ret == -ECONNREFUSED || ret == -ECONNRESET)
This page took 0.022964 seconds and 4 git commands to generate.