Fix: don't print error in comm proto connect on ENOENT
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 1 Mar 2013 16:54:31 +0000 (11:54 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 1 Mar 2013 18:06:48 +0000 (13:06 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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.025754 seconds and 4 git commands to generate.