X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Futils%2Fdummy%2Fdummy.c;h=926a6dd56728ef9fc54449c4f448568402ed6097;hb=d4393e0875e7b08f6ee97d617cc5f2c9286742a4;hp=5109259eff34033d172c923f8b8e707baa03d41b;hpb=26e21a82c47a15d1080dc142cb20c0b0b0b5a929;p=babeltrace.git diff --git a/plugins/utils/dummy/dummy.c b/plugins/utils/dummy/dummy.c index 5109259e..926a6dd5 100644 --- a/plugins/utils/dummy/dummy.c +++ b/plugins/utils/dummy/dummy.c @@ -103,9 +103,11 @@ end: enum bt_component_status dummy_consume(struct bt_private_component *component) { enum bt_component_status ret = BT_COMPONENT_STATUS_OK; - struct bt_notification *notif = NULL; + bt_notification_array notifs; + uint64_t count; struct dummy *dummy; enum bt_notification_iterator_status it_ret; + uint64_t i; dummy = bt_private_component_get_user_data(component); BT_ASSERT(dummy); @@ -122,22 +124,29 @@ enum bt_component_status dummy_consume(struct bt_private_component *component) /* Consume one notification */ it_ret = bt_private_connection_notification_iterator_next( - dummy->notif_iter, ¬if); + dummy->notif_iter, ¬ifs, &count); switch (it_ret) { - case BT_NOTIFICATION_ITERATOR_STATUS_ERROR: - ret = BT_COMPONENT_STATUS_ERROR; - goto end; + case BT_NOTIFICATION_ITERATOR_STATUS_OK: + ret = BT_COMPONENT_STATUS_OK; + + for (i = 0; i < count; i++) { + bt_put(notifs[i]); + } + + break; case BT_NOTIFICATION_ITERATOR_STATUS_AGAIN: ret = BT_COMPONENT_STATUS_AGAIN; goto end; case BT_NOTIFICATION_ITERATOR_STATUS_END: ret = BT_COMPONENT_STATUS_END; goto end; + case BT_NOTIFICATION_ITERATOR_STATUS_ERROR: + ret = BT_COMPONENT_STATUS_ERROR; + goto end; default: break; } end: - bt_put(notif); return ret; }