Fix: error on no/multiple domain options
[lttng-tools.git] / src / bin / lttng / commands / enable_channels.c
index 101617fa876be0b09464df81cd06e419f9ffb1a6..b7863332e6888837840a46995e0361adb8663c17 100644 (file)
@@ -220,9 +220,8 @@ static int enable_channel(char *session_name)
                        dom.buf_type = LTTNG_BUFFER_PER_UID;
                }
        } else {
-               print_missing_domain();
-               ret = CMD_ERROR;
-               goto error;
+               /* Checked by the caller. */
+               assert(0);
        }
 
        set_default_attr(&dom);
@@ -570,6 +569,12 @@ int cmd_enable_channels(int argc, const char **argv)
                }
        }
 
+       ret = print_missing_or_multiple_domains(opt_kernel + opt_userspace);
+       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.023077 seconds and 4 git commands to generate.