From 85f2f68cb0f248493806d8727880cea1f1021ceb Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sun, 14 Feb 2016 18:22:03 -0500 Subject: [PATCH] Fix: report already enabled event error to client MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau Conflicts: src/bin/lttng-sessiond/cmd.c --- src/bin/lttng-sessiond/cmd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 5390d7332..b71a56504 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1740,7 +1740,9 @@ static int _cmd_enable_event(struct ltt_session *session, filter_expression = NULL; filter = NULL; exclusion = NULL; - if (ret != LTTNG_OK) { + if (ret == LTTNG_ERR_UST_EVENT_ENABLED) { + goto already_enabled; + } else if (ret != LTTNG_OK) { goto error; } break; @@ -1838,7 +1840,9 @@ static int _cmd_enable_event(struct ltt_session *session, filter_copy, NULL, wpipe); } - if (ret != LTTNG_OK && ret != LTTNG_ERR_UST_EVENT_ENABLED) { + if (ret == LTTNG_ERR_UST_EVENT_ENABLED) { + goto already_enabled; + } else if (ret != LTTNG_OK) { goto error; } @@ -1865,6 +1869,7 @@ static int _cmd_enable_event(struct ltt_session *session, ret = LTTNG_OK; +already_enabled: error: free(filter_expression); free(filter); -- 2.34.1