Fix: implicit conversion of enum types in sessiond
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index d8adccde214925f2f9cd68d20ef65dadc3617951..41a321f0a3a8dc5a10d1c7d15eca79bca621241c 100644 (file)
@@ -1480,8 +1480,11 @@ static void shadow_copy_event(struct ust_app_event *ua_event,
                exclusion_alloc_size = sizeof(struct lttng_ust_event_exclusion) +
                                LTTNG_UST_SYM_NAME_LEN * uevent->exclusion->count;
                ua_event->exclusion = zmalloc(exclusion_alloc_size);
-               if (ua_event->exclusion) {
-                       memcpy(ua_event->exclusion, uevent->exclusion, exclusion_alloc_size);
+               if (ua_event->exclusion == NULL) {
+                       PERROR("malloc");
+               } else {
+                       memcpy(ua_event->exclusion, uevent->exclusion,
+                                       exclusion_alloc_size);
                }
        }
 }
@@ -3259,12 +3262,13 @@ int ust_app_list_event_fields(struct lttng_event_field **fields)
                        }
 
                        memcpy(tmp_event[count].field_name, uiter.field_name, LTTNG_UST_SYM_NAME_LEN);
-                       tmp_event[count].type = uiter.type;
+                       /* Mapping between these enums matches 1 to 1. */
+                       tmp_event[count].type = (enum lttng_event_field_type) uiter.type;
                        tmp_event[count].nowrite = uiter.nowrite;
 
                        memcpy(tmp_event[count].event.name, uiter.event_name, LTTNG_UST_SYM_NAME_LEN);
                        tmp_event[count].event.loglevel = uiter.loglevel;
-                       tmp_event[count].event.type = LTTNG_UST_TRACEPOINT;
+                       tmp_event[count].event.type = LTTNG_EVENT_TRACEPOINT;
                        tmp_event[count].event.pid = app->pid;
                        tmp_event[count].event.enabled = -1;
                        count++;
This page took 0.027078 seconds and 5 git commands to generate.