From 0b9aa170535236b924c9b85ae19dfd2aa4ac9273 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 1 Mar 2013 11:54:31 -0500 Subject: [PATCH] Fix: don't print error in comm proto connect on ENOENT Signed-off-by: Mathieu Desnoyers --- liblttng-ust-comm/lttng-ust-comm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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) -- 2.34.1