From: David Goulet Date: Fri, 9 Nov 2012 16:36:51 +0000 (-0500) Subject: Fix: Wrong data port when listing session X-Git-Tag: v2.1.0-rc7~7 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9aa9f90096acb57bdc6939920bea9fc7e4f60231;p=lttng-tools.git Fix: Wrong data port when listing session Fixes #377 Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index e4e03e88c..386b99ae2 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -101,11 +101,22 @@ static int build_network_session_path(char *dst, size_t size, goto error; } + /* + * Do we have a UST url set. If yes, this means we have both kernel and UST + * to print. + */ if (strlen(tmp_uurl) > 0) { ret = snprintf(dst, size, "[K]: %s [data: %d] -- [U]: %s [data: %d]", tmp_urls, kdata_port, tmp_uurl, udata_port); } else { - ret = snprintf(dst, size, "%s [data: %d]", tmp_urls, kdata_port); + int dport; + if (kuri) { + dport = kdata_port; + } else { + /* No kernel URI, use the UST port. */ + dport = udata_port; + } + ret = snprintf(dst, size, "%s [data: %d]", tmp_urls, dport); } error: