From: Jérémie Galarneau Date: Tue, 9 Feb 2021 23:36:16 +0000 (-0500) Subject: sessiond: convert invalid command return codes to LTTNG_ERR_UNK X-Git-Tag: v2.13.0-rc1~346 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c7e9ffbd609dd9ea07e4556e8a20bbd72916ee29;p=lttng-tools.git sessiond: convert invalid command return codes to LTTNG_ERR_UNK Signed-off-by: Jérémie Galarneau Change-Id: Ie68b4f11b28e8cbbae2fc3e4593d468572a8dce1 --- diff --git a/src/bin/lttng-sessiond/client.c b/src/bin/lttng-sessiond/client.c index 09e683a71..c0086953a 100644 --- a/src/bin/lttng-sessiond/client.c +++ b/src/bin/lttng-sessiond/client.c @@ -2616,6 +2616,11 @@ static void *thread_manage_clients(void *data) continue; } + if (ret < LTTNG_OK || ret >= LTTNG_ERR_NR) { + WARN("Command returned an invalid status code, returning unknown error: command type = %d, ret = %d", cmd_ctx.lsm.cmd_type, ret); + ret = LTTNG_ERR_UNK; + } + cmd_completion_handler = cmd_pop_completion_handler(); if (cmd_completion_handler) { enum lttng_error_code completion_code;