Check for context name duplicata
[lttng-modules.git] / lttng-context-comm.c
index ede3f51a0d4bd9ffd9568d75a28e1fc4ebc75668..beea83ffc14e471769a7c34da63591adb2a63fd4 100644 (file)
@@ -45,6 +45,10 @@ int lttng_add_comm_to_ctx(struct lttng_ctx **ctx)
        field = lttng_append_context(ctx);
        if (!field)
                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.02347 seconds and 4 git commands to generate.