- if (domain) {
- switch (domain->type) {
- case LTTNG_DOMAIN_KERNEL:
- if (ev == NULL) {
- ret = ask_sessiond(LTTNG_KERNEL_ENABLE_ALL_EVENT, NULL);
- } else {
- memcpy(&lsm.u.enable.event, ev, sizeof(struct lttng_event));
- ret = ask_sessiond(LTTNG_KERNEL_ENABLE_EVENT, NULL);
- }
- break;
- case LTTNG_DOMAIN_UST:
- ret = LTTCOMM_NOT_IMPLEMENTED;
- break;
- default:
- ret = LTTCOMM_UNKNOWN_DOMAIN;
- break;
- };
+ copy_lttng_domain(domain);
+
+ if (ev == NULL) {
+ ret = ask_sessiond(LTTNG_ENABLE_ALL_EVENT, NULL);
+ } else {
+ memcpy(&lsm.u.enable.event, ev, sizeof(struct lttng_event));
+ ret = ask_sessiond(LTTNG_ENABLE_EVENT, NULL);