X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftracker.c;h=15779ce722448abbf15403ceeb79a179685594f5;hb=ab5be9fa2eb5ba9600a82cd18fd3cfcbac69169a;hp=48dc176c15374d2810532dfc3207aa0625882516;hpb=a7a533cd65d544e8beebabcca5fe906e27af4707;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/tracker.c b/src/bin/lttng-sessiond/tracker.c index 48dc176c1..15779ce72 100644 --- a/src/bin/lttng-sessiond/tracker.c +++ b/src/bin/lttng-sessiond/tracker.c @@ -1,18 +1,8 @@ /* - * Copyright (C) 2018 - Mathieu Desnoyers + * Copyright (C) 2018 Mathieu Desnoyers * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2 only, - * as published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _LGPL_SOURCE @@ -493,14 +483,19 @@ error: int lttng_tracker_id_set_list(struct lttng_tracker_list *tracker_list, const struct lttng_tracker_ids *ids) { - size_t i, count; + unsigned int i, count; const struct lttng_tracker_id *id; + enum lttng_tracker_id_status status; assert(tracker_list); assert(ids); lttng_tracker_list_reset(tracker_list); - count = lttng_tracker_ids_get_count(ids); + + status = lttng_tracker_ids_get_count(ids, &count); + if (status != LTTNG_TRACKER_ID_STATUS_OK) { + return LTTNG_ERR_INVALID; + } if (count == 0) { /* Set state to "track none". */