From 4e328cceb6ff5fd6240c866b52b29234946c5c66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Genevi=C3=A8ve=20Bastien?= Date: Mon, 17 Jun 2019 12:56:21 -0400 Subject: [PATCH 1/1] Fix: error when listing sessions with no session MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit lttng_list_sessions() returns a "fatal error" code when lttng_ctl_ask_sessiond() returns 0. This was interpreted as the control socket being shutdown unexpectedly. However, it is (more often) caused by no sessions being available. Given that, it makes more sense to report that no sessions are available. More clean-up/refactoring would be needed to report unexpected socket shutdowns. Fixes #1188 Signed-off-by: Geneviève Bastien Signed-off-by: Jérémie Galarneau --- src/lib/lttng-ctl/lttng-ctl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index f50ca3061..20dca8132 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -2077,7 +2077,6 @@ int lttng_list_sessions(struct lttng_session **out_sessions) lsm.cmd_type = LTTNG_LIST_SESSIONS; ret = lttng_ctl_ask_sessiond(&lsm, (void**) &sessions); if (ret <= 0) { - ret = ret == 0 ? -LTTNG_ERR_FATAL : ret; goto end; } if (!sessions) { -- 2.34.1