X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fadd_context.c;h=fb37c0aa738f202b6d9a8dbd1a32f1470e91420c;hp=5ac755199eead42c69e90befeecb3f4aec5bdc71;hb=c2d6932774987366baf42a93461cd73c38f1113a;hpb=8e8f2c41310a1253c333d0f941d72bc079a57363 diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c index 5ac755199..fb37c0aa7 100644 --- a/src/bin/lttng/commands/add_context.c +++ b/src/bin/lttng/commands/add_context.c @@ -15,7 +15,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -25,6 +24,7 @@ #include #include #include +#include #include @@ -562,9 +562,7 @@ static int add_context(char *session_name) } else if (opt_userspace) { dom.type = LTTNG_DOMAIN_UST; } else { - print_missing_domain(); - ret = CMD_ERROR; - goto error; + assert(0); } handle = lttng_create_handle(session_name, &dom); @@ -740,6 +738,13 @@ int cmd_add_context(int argc, const char **argv) } } + ret = print_missing_or_multiple_domains(opt_kernel + opt_userspace); + + if (ret) { + ret = CMD_ERROR; + goto end; + } + if (!opt_type) { ERR("Missing mandatory -t TYPE"); usage(stderr);