From e569405f2cc82525cf67cf5f34cd9ea59aa984c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 27 Mar 2019 15:42:19 -0400 Subject: [PATCH] Fix: wrong error code returned by kernel_snapshot_record() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On snapshot error, kernel_snapshot_record() can return LTTNG_ERR_KERN_CONSUMER_FAIL which means that the kernel consumer daemon failed to launch. In this path, the appropriate error to return is LTTNG_ERR_KERN_META_FAIL. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/kernel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index b1a3f0b70..07525480e 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -1022,7 +1022,7 @@ int kernel_snapshot_record(struct ltt_kernel_session *ksess, /* Put back the saved consumer output into the session. */ ksess->consumer = saved_output; if (ret < 0) { - ret = LTTNG_ERR_KERN_CONSUMER_FAIL; + ret = LTTNG_ERR_KERN_META_FAIL; goto error_consumer; } -- 2.34.1