Fix: error on no/multiple domain options
[lttng-tools.git] / src / bin / lttng / commands / disable_events.c
index b50882e04ff0d70d3518d173db856625d9eb3432..b75ee7b5395d1005b03ebe4993bd503cf5707691 100644 (file)
@@ -179,9 +179,8 @@ static int disable_events(char *session_name)
        } else if (opt_log4j) {
                dom.type = LTTNG_DOMAIN_LOG4J;
        } else {
-               print_missing_domain();
-               ret = CMD_ERROR;
-               goto error;
+               /* Checked by the caller. */
+               assert(0);
        }
 
        channel_name = opt_channel_name;
@@ -371,6 +370,13 @@ int cmd_disable_events(int argc, const char **argv)
                }
        }
 
+       ret = print_missing_or_multiple_domains(
+               opt_kernel + opt_userspace + opt_jul + opt_log4j);
+       if (ret) {
+               ret = CMD_ERROR;
+               goto end;
+       }
+
        opt_event_list = (char*) poptGetArg(pc);
        if (opt_event_list == NULL && opt_disable_all == 0) {
                ERR("Missing event name(s).\n");
This page took 0.024365 seconds and 4 git commands to generate.