projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: error on no/multiple domain options
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
track-untrack.c
diff --git
a/src/bin/lttng/commands/track-untrack.c
b/src/bin/lttng/commands/track-untrack.c
index bb3fc551b1e30c6b86e782004163a695e7bbda5b..ea05574514ab698e06c65b46e4f7dce84e8c13f5 100644
(file)
--- a/
src/bin/lttng/commands/track-untrack.c
+++ b/
src/bin/lttng/commands/track-untrack.c
@@
-26,6
+26,7
@@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include <assert.h>
#include <urcu/list.h>
#include <urcu/list.h>
@@
-229,9
+230,8
@@
enum cmd_error_code track_untrack_pid(enum cmd_type cmd_type, const char *cmd_st
} 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 end;
+ /* Checked by the caller. */
+ assert(0);
}
ret = parse_pid_string(pid_string, all, &pid_list, &nr_pids);
}
ret = parse_pid_string(pid_string, all, &pid_list, &nr_pids);
@@
-381,10
+381,9
@@
int cmd_track_untrack(enum cmd_type cmd_type, const char *cmd_str,
}
}
}
}
- if (!(opt_userspace ^ opt_kernel)) {
- ERR("Exactly one of -u or -k needs to be specified.");
- usage(stderr, cmd_str);
- command_ret = CMD_ERROR;
+ ret = print_missing_or_multiple_domains(opt_kernel + opt_userspace);
+ if (ret) {
+ ret = CMD_ERROR;
goto end;
}
goto end;
}
This page took
0.02343 seconds
and
4
git commands to generate.