From: Mathieu Desnoyers Date: Fri, 1 Mar 2013 16:54:31 +0000 (-0500) Subject: Fix: don't print error in comm proto connect on ENOENT X-Git-Tag: v2.2.0-rc1~65 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0b9aa170535236b924c9b85ae19dfd2aa4ac9273;p=lttng-ust.git Fix: don't print error in comm proto connect on ENOENT Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust-comm/lttng-ust-comm.c b/liblttng-ust-comm/lttng-ust-comm.c index 3644a162..a666ab27 100644 --- a/liblttng-ust-comm/lttng-ust-comm.c +++ b/liblttng-ust-comm/lttng-ust-comm.c @@ -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)