projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix return value and mem leak for all commands
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
disable_channels.c
diff --git
a/src/bin/lttng/commands/disable_channels.c
b/src/bin/lttng/commands/disable_channels.c
index bdbb657921ce3483d052dca50b9e0f7a3831eba2..05ee0e6ef65dca36c4d09efa4f65cf8d9bf21059 100644
(file)
--- a/
src/bin/lttng/commands/disable_channels.c
+++ b/
src/bin/lttng/commands/disable_channels.c
@@
-140,7
+140,7
@@
error:
*/
int cmd_disable_channels(int argc, const char **argv)
{
*/
int cmd_disable_channels(int argc, const char **argv)
{
- int opt, ret;
+ int opt, ret
= CMD_SUCCESS
;
static poptContext pc;
char *session_name = NULL;
static poptContext pc;
char *session_name = NULL;
@@
-150,15
+150,13
@@
int cmd_disable_channels(int argc, const char **argv)
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case OPT_HELP:
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case OPT_HELP:
- usage(stderr);
- ret = CMD_SUCCESS;
+ usage(stdout);
goto end;
case OPT_USERSPACE:
opt_userspace = 1;
break;
case OPT_LIST_OPTIONS:
list_cmd_options(stdout, long_options);
goto end;
case OPT_USERSPACE:
opt_userspace = 1;
break;
case OPT_LIST_OPTIONS:
list_cmd_options(stdout, long_options);
- ret = CMD_SUCCESS;
goto end;
default:
usage(stderr);
goto end;
default:
usage(stderr);
@@
-171,14
+169,14
@@
int cmd_disable_channels(int argc, const char **argv)
if (opt_channels == NULL) {
ERR("Missing channel name(s).\n");
usage(stderr);
if (opt_channels == NULL) {
ERR("Missing channel name(s).\n");
usage(stderr);
- ret = CMD_
SUCCESS
;
+ ret = CMD_
ERROR
;
goto end;
}
if (!opt_session_name) {
session_name = get_session_name();
if (session_name == NULL) {
goto end;
}
if (!opt_session_name) {
session_name = get_session_name();
if (session_name == NULL) {
- ret =
-1
;
+ ret =
CMD_ERROR
;
goto end;
}
} else {
goto end;
}
} else {
@@
-188,5
+186,6
@@
int cmd_disable_channels(int argc, const char **argv)
ret = disable_channels(session_name);
end:
ret = disable_channels(session_name);
end:
+ poptFreeContext(pc);
return ret;
}
return ret;
}
This page took
0.02603 seconds
and
4
git commands to generate.