Fix: error on no/multiple domain options
[lttng-tools.git] / src / bin / lttng / commands / disable_channels.c
index 96a9e5d6c93292f9c6d101d56b9b8f904ebdce2a..6bb123fc72a71ea3a29e0a74fca174f437a0676c 100644 (file)
@@ -143,9 +143,8 @@ static int disable_channels(char *session_name)
        } else if (opt_userspace) {
                dom.type = LTTNG_DOMAIN_UST;
        } else {
        } else if (opt_userspace) {
                dom.type = LTTNG_DOMAIN_UST;
        } else {
-               print_missing_domain();
-               ret = CMD_ERROR;
-               goto error;
+               /* Checked by the caller. */
+               assert(0);
        }
 
        handle = lttng_create_handle(session_name, &dom);
        }
 
        handle = lttng_create_handle(session_name, &dom);
@@ -261,6 +260,12 @@ int cmd_disable_channels(int argc, const char **argv)
                }
        }
 
                }
        }
 
+       ret = print_missing_or_multiple_domains(opt_kernel + opt_userspace);
+       if (ret) {
+               ret = CMD_ERROR;
+               goto end;
+       }
+
        opt_channels = (char*) poptGetArg(pc);
        if (opt_channels == NULL) {
                ERR("Missing channel name(s).\n");
        opt_channels = (char*) poptGetArg(pc);
        if (opt_channels == NULL) {
                ERR("Missing channel name(s).\n");
This page took 0.023631 seconds and 4 git commands to generate.