X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-ust.c;h=c80d5e772de8c48e913b5399f23be7af785241c5;hb=850767541647c102a299d7fbc39c97555ac70224;hp=9eabf6225376360d2eef8e9d83d33b668e84c35e;hpb=b0a5f0fbc428de5cd15a5c86f95a12f32e8c3c88;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 9eabf6225..c80d5e772 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -128,6 +128,13 @@ struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht, struct lttng_ht_node_str *node; struct lttng_ht_iter iter; + /* + * If we receive an empty string for channel name, it means the + * default channel name is requested. + */ + if (name[0] == '\0') + name = DEFAULT_CHANNEL_NAME; + lttng_ht_lookup(ht, (void *)name, &iter); node = lttng_ht_iter_get_node_str(&iter); if (node == NULL) { @@ -268,8 +275,16 @@ struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *chan) break; } - /* Copy channel name */ - strncpy(luc->name, chan->name, sizeof(luc->name)); + /* + * If we receive an empty string for channel name, it means the + * default channel name is requested. + */ + if (chan->name[0] == '\0') { + strncpy(luc->name, DEFAULT_CHANNEL_NAME, sizeof(luc->name)); + } else { + /* Copy channel name */ + strncpy(luc->name, chan->name, sizeof(luc->name)); + } luc->name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0'; /* Init node */