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 out on leftover arguments
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
disable_events.c
diff --git
a/src/bin/lttng/commands/disable_events.c
b/src/bin/lttng/commands/disable_events.c
index e301b71b38642a0b841df04ed658fdb4bd025f0c..3c53c75c29d23813f41d9a087b58cb0538cfc05c 100644
(file)
--- a/
src/bin/lttng/commands/disable_events.c
+++ b/
src/bin/lttng/commands/disable_events.c
@@
-322,6
+322,7
@@
int cmd_disable_events(int argc, const char **argv)
int opt, ret = CMD_SUCCESS, command_ret = CMD_SUCCESS, success = 1;
static poptContext pc;
char *session_name = NULL;
int opt, ret = CMD_SUCCESS, command_ret = CMD_SUCCESS, success = 1;
static poptContext pc;
char *session_name = NULL;
+ const char *leftover = NULL;
int event_type = -1;
pc = poptGetContext(NULL, argc, argv, long_options, 0);
int event_type = -1;
pc = poptGetContext(NULL, argc, argv, long_options, 0);
@@
-392,6
+393,13
@@
int cmd_disable_events(int argc, const char **argv)
goto end;
}
goto end;
}
+ leftover = poptGetArg(pc);
+ if (leftover) {
+ ERR("Unknown argument: %s", leftover);
+ ret = CMD_ERROR;
+ goto end;
+ }
+
if (!opt_session_name) {
session_name = get_session_name();
if (session_name == NULL) {
if (!opt_session_name) {
session_name = get_session_name();
if (session_name == NULL) {
@@
-467,7
+475,7
@@
end:
ret = ret ? ret : LTTNG_ERR_MI_IO_FAIL;
}
ret = ret ? ret : LTTNG_ERR_MI_IO_FAIL;
}
- /* Overwrite ret if an error occured in disable_events */
+ /* Overwrite ret if an error occur
r
ed in disable_events */
ret = command_ret ? command_ret : ret;
poptFreeContext(pc);
ret = command_ret ? command_ret : ret;
poptFreeContext(pc);
This page took
0.023875 seconds
and
4
git commands to generate.