Check for context name duplicata
[lttng-modules.git] / lttng-context-vtid.c
index f81fff636acd35d914a2756c567e68d03d562c24..c428911ef98aff76bdb822dc72e494febcf41b64 100644 (file)
@@ -40,11 +40,14 @@ void vtid_record(struct lttng_ctx_field *field,
 int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx)
 {
        struct lttng_ctx_field *field;
-       int ret;
 
        field = lttng_append_context(ctx);
        if (!field)
                return -ENOMEM;
+       if (lttng_find_context(*ctx, "vtid")) {
+               lttng_remove_context_field(ctx, field);
+               return -EEXIST;
+       }
        field->event_field.name = "vtid";
        field->event_field.type.atype = atype_integer;
        field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;
This page took 0.024214 seconds and 4 git commands to generate.