X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=lttng-context-vpid.c;h=f12eb97efebe25bbae9355320a3d9e5a16da0577;hb=0f9c99095c8a1de40f47c50d1c29184771ed23bc;hp=3bbb87f413f25512b5b393eebaeb8110c16e1485;hpb=b64bc438d1c9bbcf241c598ca9f0e00d5770d784;p=lttng-modules.git diff --git a/lttng-context-vpid.c b/lttng-context-vpid.c index 3bbb87f4..f12eb97e 100644 --- a/lttng-context-vpid.c +++ b/lttng-context-vpid.c @@ -40,11 +40,14 @@ void vpid_record(struct lttng_ctx_field *field, int lttng_add_vpid_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, "vpid")) { + lttng_remove_context_field(ctx, field); + return -EEXIST; + } field->event_field.name = "vpid"; field->event_field.type.atype = atype_integer; field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;