X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbin%2Flttng%2Fcommands%2Flist.c;h=71843fdab9ee6d07f50358a3d0f24006e2444b7b;hb=c119cdb1e4cf3e0fd5080160a5c4286cd7391714;hp=50d6114c3d166be10483b71974b6418cf6152494;hpb=6179b377e769efa1541f98db56573519b787e858;p=lttng-tools.git diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 50d6114c3..71843fdab 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -25,6 +25,8 @@ #include "../command.h" +#include + static int opt_userspace; static int opt_kernel; static char *opt_channel; @@ -412,11 +414,21 @@ static int list_channels(const char *channel_name) count = lttng_list_channels(handle, &channels); if (count < 0) { - ret = count; + switch (-count) { + case LTTCOMM_KERN_CHAN_NOT_FOUND: + ret = CMD_SUCCESS; + WARN("No kernel channel"); + break; + case LTTCOMM_UST_CHAN_NOT_FOUND: + ret = CMD_SUCCESS; + WARN("No UST channel"); + break; + default: + /* We had a real error */ + ret = count; + ERR("%s", lttng_strerror(ret)); + } goto error_channels; - } else if (count == 0) { - ERR("Channel %s not found", channel_name); - goto error; } if (channel_name == NULL) {