X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-events.c;h=47460102ef8813de503d1feeb0cf4b793547b8d8;hb=ae4b659d95f8dab9f2aa4b890d6937d7d5375f07;hp=664f8b5d05c6f82a1bb55e1a085ee6c9b4e6479f;hpb=ab89263ef2f50399e608e74557900aa0a3165a61;p=lttng-ust.git diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index 664f8b5d..47460102 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -1,23 +1,9 @@ /* - * lttng-events.c - * - * Holds LTTng per-session event registry. + * SPDX-License-Identifier: LGPL-2.1-only * * Copyright (C) 2010-2012 Mathieu Desnoyers * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; only - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Holds LTTng per-session event registry. */ #define _LGPL_SOURCE @@ -51,8 +37,8 @@ #include #include #include -#include -#include +#include +#include #include "error.h" #include "compat.h" #include "lttng-ust-uuid.h" @@ -1526,12 +1512,14 @@ int lttng_event_notifier_enabler_attach_filter_bytecode( int lttng_event_notifier_enabler_attach_capture_bytecode( struct lttng_event_notifier_enabler *event_notifier_enabler, - struct lttng_ust_bytecode_node *bytecode) + struct lttng_ust_bytecode_node **bytecode) { - bytecode->enabler = lttng_event_notifier_enabler_as_enabler( + (*bytecode)->enabler = lttng_event_notifier_enabler_as_enabler( event_notifier_enabler); - cds_list_add_tail(&bytecode->node, + cds_list_add_tail(&(*bytecode)->node, &event_notifier_enabler->capture_bytecode_head); + /* Take ownership of bytecode */ + *bytecode = NULL; event_notifier_enabler->num_captures++; lttng_event_notifier_group_sync_enablers(event_notifier_enabler->group);