X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=lttng-context-ppid.c;h=738f7e6882d518d95b2ebe559ede4e683363bbf9;hb=6064fe3a84e4225e80ab191eae5a38de31f3fc7e;hp=342aa343337b2a55a380da763651a9e22225cf96;hpb=b64bc438d1c9bbcf241c598ca9f0e00d5770d784;p=lttng-modules.git diff --git a/lttng-context-ppid.c b/lttng-context-ppid.c index 342aa343..738f7e68 100644 --- a/lttng-context-ppid.c +++ b/lttng-context-ppid.c @@ -43,11 +43,14 @@ void ppid_record(struct lttng_ctx_field *field, int lttng_add_ppid_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, "ppid")) { + lttng_remove_context_field(ctx, field); + return -EEXIST; + } field->event_field.name = "ppid"; field->event_field.type.atype = atype_integer; field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;