Fix: error on no/multiple domain options
[lttng-tools.git] / src / bin / lttng / commands / enable_events.c
index 68d49769bcfdc5834422b73c7c68c8c2062287ab..972043eeb25f672c9ec02d9f13232c4ca80d98b1 100644 (file)
@@ -721,9 +721,8 @@ static int enable_events(char *session_name)
                /* Default. */
                dom.buf_type = LTTNG_BUFFER_PER_UID;
        } else {
-               print_missing_domain();
-               ret = CMD_ERROR;
-               goto error;
+               /* Checked by the caller. */
+               assert(0);
        }
 
        if (opt_exclude) {
@@ -1150,9 +1149,7 @@ static int enable_events(char *session_name)
                        strncpy(ev.name, event_name, LTTNG_SYMBOL_NAME_LEN);
                        ev.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
                } else {
-                       print_missing_domain();
-                       ret = CMD_ERROR;
-                       goto error;
+                       assert(0);
                }
 
                if (!opt_filter) {
@@ -1431,6 +1428,13 @@ int cmd_enable_events(int argc, const char **argv)
                }
        }
 
+       ret = print_missing_or_multiple_domains(
+               opt_kernel + opt_userspace + opt_jul + opt_log4j + opt_python);
+       if (ret) {
+               ret = CMD_ERROR;
+               goto end;
+       }
+
        /* Mi check */
        if (lttng_opt_mi) {
                writer = mi_lttng_writer_create(fileno(stdout), lttng_opt_mi);
This page took 0.024798 seconds and 4 git commands to generate.