Fix: report already enabled event error to client
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 14 Feb 2016 23:22:03 +0000 (18:22 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 14 Feb 2016 23:22:03 +0000 (18:22 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c

index 8e06ce6913875dd85e0a17e0eeafb929ba93d425..821f01cd409d2fa092346ed7b8a9454fb64eb27e 100644 (file)
@@ -1791,7 +1791,9 @@ static int _cmd_enable_event(struct ltt_session *session,
                filter_expression = NULL;
                filter = NULL;
                exclusion = NULL;
-               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;
                }
                break;
@@ -1889,7 +1891,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;
                }
 
@@ -1916,6 +1920,7 @@ static int _cmd_enable_event(struct ltt_session *session,
 
        ret = LTTNG_OK;
 
+already_enabled:
 error:
        free(filter_expression);
        free(filter);
This page took 0.03595 seconds and 4 git commands to generate.