X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Flist.c;h=4def4e7a2ee3aa050599a661aeb162d5c2d179cb;hp=d84fd2ba97d6e78551b3f07d07ea649d5dc6ffb5;hb=ae8564917fa3cb3497ec17951d8ac0ee28de9c81;hpb=4747a49b20089e4ac15d02a5191bd6cca8567e2f diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index d84fd2ba9..4def4e7a2 100644 --- 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; - goto error; + goto error_channels; } else if (count == 0) { - MSG("No channel found"); - goto end; + ERR("Channel %s not found", channel_name); + goto error; } if (channel_name == NULL) { @@ -421,14 +421,16 @@ static int list_channels(const char *channel_name) } 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: + free(channels); + +error_channels: return ret; } @@ -475,7 +477,7 @@ static int list_sessions(const char *session_name) 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) {