sessiond: convert invalid command return codes to LTTNG_ERR_UNK
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 9 Feb 2021 23:36:16 +0000 (18:36 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 9 Feb 2021 23:39:24 +0000 (18:39 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ie68b4f11b28e8cbbae2fc3e4593d468572a8dce1

src/bin/lttng-sessiond/client.c

index 09e683a712d8b41914f9938d306b65b506c74635..c0086953a8e06bb1bb4405e3f0b3ba0954a407b4 100644 (file)
@@ -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;
This page took 0.026822 seconds and 4 git commands to generate.