Fix: report already enabled event error to client
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 83286a00213fc6df857d1573f01304a008a3290c..821f01cd409d2fa092346ed7b8a9454fb64eb27e 100644 (file)
@@ -1406,6 +1406,7 @@ int cmd_add_context(struct ltt_session *session, enum lttng_domain_type domain,
                        ret = LTTNG_ERR_UST_CHAN_NOT_FOUND;
                        goto error;
                }
+               /* break is _not_ missing here. */
        }
        case LTTNG_DOMAIN_UST:
        {
@@ -1790,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;
@@ -1888,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;
                }
 
@@ -1915,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.037335 seconds and 5 git commands to generate.