From 51630bd8cf4eaffdc8da8fec3c10f46c8110ddea Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 14 Jan 2019 17:09:42 -0500 Subject: [PATCH] Fix: wrong error check on kernel session creation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit create_kernel_session() returns a positive lttng error code on error and returns LTTNG_OK on success. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/client.c b/src/bin/lttng-sessiond/client.c index 8cf28a9d6..67e246b63 100644 --- a/src/bin/lttng-sessiond/client.c +++ b/src/bin/lttng-sessiond/client.c @@ -884,7 +884,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock, if (need_tracing_session) { if (cmd_ctx->session->kernel_session == NULL) { ret = create_kernel_session(cmd_ctx->session); - if (ret < 0) { + if (ret != LTTNG_OK) { ret = LTTNG_ERR_KERN_SESS_FAIL; goto error; } -- 2.34.1