Add missing memcpy callback
[lttng-modules.git] / lttng-context-comm.c
index 6e51bf854a3bad17765085d493c7536d94686b81..beea83ffc14e471769a7c34da63591adb2a63fd4 100644 (file)
@@ -41,11 +41,14 @@ void comm_record(struct lttng_ctx_field *field,
 int lttng_add_comm_to_ctx(struct lttng_ctx **ctx)
 {
        struct lttng_ctx_field *field;
-       int ret;
 
        field = lttng_append_context(ctx);
        if (!field)
-               return ret;
+               return -ENOMEM;
+       if (lttng_find_context(*ctx, "comm")) {
+               lttng_remove_context_field(ctx, field);
+               return -EEXIST;
+       }
        field->event_field.name = "comm";
        field->event_field.type.atype = atype_array;
        field->event_field.type.u.array.elem_type.atype = atype_integer;
This page took 0.022255 seconds and 4 git commands to generate.