*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <assert.h>
#include <inttypes.h>
#include <urcu/list.h>
* possible to enable channel thus inform the client.
*/
if (usess && usess->domain_global.channels) {
+ rcu_read_lock();
nb_chan += lttng_ht_get_count(usess->domain_global.channels);
+ rcu_read_unlock();
}
if (ksession) {
nb_chan += ksession->channel_count;
}
}
+ if (!nb_dom) {
+ goto end;
+ }
+
*domains = zmalloc(nb_dom * sizeof(struct lttng_domain));
if (*domains == NULL) {
ret = LTTNG_ERR_FATAL;
}
}
}
-
+end:
return nb_dom;
error:
session->ust_session->domain_global.channels);
}
DBG3("Number of UST global channels %zd", nb_chan);
- if (nb_chan <= 0) {
+ if (nb_chan < 0) {
ret = LTTNG_ERR_UST_CHAN_NOT_FOUND;
+ goto error;
}
break;
default:
- *channels = NULL;
ret = LTTNG_ERR_UND;
goto error;
}
}
list_lttng_channels(domain, session, *channels);
- } else {
- *channels = NULL;
- /* Ret value was set in the domain switch case */
- goto error;
}
return nb_chan;