Refactoring: move count to an output parameter
[lttng-tools.git] / src / bin / lttng / commands / list.c
index 229648e07cebe7018d2dfa80fc67151fff97a15c..2af59c433067a030da7c221cccb61b3c8b77f9cf 100644 (file)
@@ -1540,15 +1540,21 @@ static int list_tracker_ids(enum lttng_tracker_type tracker_type)
        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) {
This page took 0.022985 seconds and 4 git commands to generate.