X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-context-comm.c;h=beea83ffc14e471769a7c34da63591adb2a63fd4;hb=7e42c4ec17806634672405848eaacc4815840281;hp=6e51bf854a3bad17765085d493c7536d94686b81;hpb=25b2f99ab44a986f4850ece6eaadb2ead024c924;p=lttng-modules.git diff --git a/lttng-context-comm.c b/lttng-context-comm.c index 6e51bf85..beea83ff 100644 --- a/lttng-context-comm.c +++ b/lttng-context-comm.c @@ -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;