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 <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I79fe41afd49a1c701e760e415b72aabdc9b25f6c
}
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;
}
sizeof(session->shm_path));
session->shm_path[sizeof(session->shm_path) - 1] = '\0';
- return 0;
+ return LTTNG_OK;
}
/*