/*
- * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
*
- * 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
int ret = 0;
int enabled = 1;
struct lttng_tracker_ids *ids = NULL;
- size_t nr_ids, i;
+ unsigned int nr_ids, i;
const struct lttng_tracker_id *id;
+ enum lttng_tracker_id_status status;
ret = lttng_list_tracker_ids(handle, tracker_type, &ids);
if (ret) {
return ret;
}
- nr_ids = lttng_tracker_ids_get_count(ids);
+ status = lttng_tracker_ids_get_count(ids, &nr_ids);
+ if (status != LTTNG_TRACKER_ID_STATUS_OK) {
+ ret = CMD_ERROR;
+ goto end;
+ }
+
if (nr_ids == 1) {
id = lttng_tracker_ids_get_at_index(ids, 0);
if (id && lttng_tracker_id_get_type(id) == LTTNG_ID_ALL) {