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:44:19 +0000 (18:44 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Conflicts:
src/bin/lttng-sessiond/cmd.c

src/bin/lttng-sessiond/cmd.c

index 5390d7332e8a33b58233b41e2771ebc635af99e1..b71a56504ad1e13b2c40c1d33251929272a591c5 100644 (file)
@@ -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);
This page took 0.028473 seconds and 4 git commands to generate.