Fix: error when listing sessions with no session
authorGeneviève Bastien <gbastien@versatic.net>
Mon, 17 Jun 2019 16:56:21 +0000 (12:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 18 Jun 2019 18:17:09 +0000 (14:17 -0400)
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 <gbastien@versatic.net>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/lib/lttng-ctl/lttng-ctl.c

index f50ca306145f9b30e28b24f3bfea500f9181f1f4..20dca8132186e46531589d9294b31a44dc52e9b3 100644 (file)
@@ -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) {
This page took 0.032063 seconds and 4 git commands to generate.