From: Francis Deslauriers Date: Thu, 11 Mar 2021 16:06:53 +0000 (-0500) Subject: Fix: sessiond: return _OK on _SET_SESSION_SHM_PATH command success X-Git-Tag: v2.13.0-rc1~246 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=7e397c55fae384e3218be22e13996d7989611f25 Fix: sessiond: return _OK on _SET_SESSION_SHM_PATH command success Issue ===== When running the `test_crash` tests, I witness the following warning: Warning: Command returned an invalid status code, returning unknown error: command type = 40, ret = 0 The `cmd_set_session_shm_path()` function is returning 0 on success instead of the expected LTTNG_OK which leads to this warning being printed. Fix === Return LTTNG_OK. Side note ========= I added the string version of the command name in the warning printing for easier debugging. Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau Change-Id: I79fe41afd49a1c701e760e415b72aabdc9b25f6c --- diff --git a/src/bin/lttng-sessiond/client.c b/src/bin/lttng-sessiond/client.c index d752fb94e..770a2ee44 100644 --- a/src/bin/lttng-sessiond/client.c +++ b/src/bin/lttng-sessiond/client.c @@ -2618,7 +2618,10 @@ static void *thread_manage_clients(void *data) } 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); + WARN("Command returned an invalid status code, returning unknown error: " + "command type = %s (%d), ret = %d", + lttcomm_sessiond_command_str(cmd_ctx.lsm.cmd_type), + cmd_ctx.lsm.cmd_type, ret); ret = LTTNG_ERR_UNK; } diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 2d94204d3..a6f1a4db6 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -5124,7 +5124,7 @@ int cmd_set_session_shm_path(struct ltt_session *session, sizeof(session->shm_path)); session->shm_path[sizeof(session->shm_path) - 1] = '\0'; - return 0; + return LTTNG_OK; } /*