projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve error handling of lttng cli
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
list.c
diff --git
a/src/bin/lttng/commands/list.c
b/src/bin/lttng/commands/list.c
index d84fd2ba97d6e78551b3f07d07ea649d5dc6ffb5..4def4e7a2ee3aa050599a661aeb162d5c2d179cb 100644
(file)
--- a/
src/bin/lttng/commands/list.c
+++ b/
src/bin/lttng/commands/list.c
@@
-389,10
+389,10
@@
static int list_channels(const char *channel_name)
count = lttng_list_channels(handle, &channels);
if (count < 0) {
ret = count;
count = lttng_list_channels(handle, &channels);
if (count < 0) {
ret = count;
- goto error;
+ goto error
_channels
;
} else if (count == 0) {
} else if (count == 0) {
-
MSG("No channel found"
);
- goto e
nd
;
+
ERR("Channel %s not found", channel_name
);
+ goto e
rror
;
}
if (channel_name == NULL) {
}
if (channel_name == NULL) {
@@
-421,14
+421,16
@@
static int list_channels(const char *channel_name)
}
if (!chan_found && channel_name != NULL) {
}
if (!chan_found && channel_name != NULL) {
- MSG("Channel %s not found", channel_name);
+ ERR("Channel %s not found", channel_name);
+ goto error;
}
}
-end:
- free(channels);
ret = CMD_SUCCESS;
error:
ret = CMD_SUCCESS;
error:
+ free(channels);
+
+error_channels:
return ret;
}
return ret;
}
@@
-475,7
+477,7
@@
static int list_sessions(const char *session_name)
free(sessions);
if (!session_found && session_name != NULL) {
free(sessions);
if (!session_found && session_name != NULL) {
-
MSG
("Session %s not found", session_name);
+
ERR
("Session %s not found", session_name);
}
if (session_name == NULL) {
}
if (session_name == NULL) {
This page took
0.025198 seconds
and
4
git commands to generate.