From 8812600c6eff8ee50966d685a7922e797ce97610 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 24 Apr 2017 16:30:01 -0400 Subject: [PATCH] utils.dummy: handle AGAIN and END statuses correctly MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- plugins/utils/dummy/dummy.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/plugins/utils/dummy/dummy.c b/plugins/utils/dummy/dummy.c index 01782859..3d7de4d5 100644 --- a/plugins/utils/dummy/dummy.c +++ b/plugins/utils/dummy/dummy.c @@ -110,7 +110,7 @@ end: enum bt_component_status dummy_consume(struct bt_private_component *component) { - enum bt_component_status ret; + enum bt_component_status ret = BT_COMPONENT_STATUS_OK; struct bt_notification *notif = NULL; size_t i; struct dummy *dummy; @@ -135,26 +135,16 @@ enum bt_component_status dummy_consume(struct bt_private_component *component) case BT_NOTIFICATION_ITERATOR_STATUS_ERROR: ret = BT_COMPONENT_STATUS_ERROR; goto end; + case BT_NOTIFICATION_ITERATOR_STATUS_AGAIN: + ret = BT_COMPONENT_STATUS_AGAIN; + goto end; case BT_NOTIFICATION_ITERATOR_STATUS_END: - ret = BT_COMPONENT_STATUS_END; g_ptr_array_remove_index(dummy->iterators, i); i--; continue; default: break; } - - notif = bt_notification_iterator_get_notification(it); - if (!notif) { - ret = BT_COMPONENT_STATUS_ERROR; - goto end; - } - - /* - * Dummy! I'm doing nothing with this notification, - * NOTHING. - */ - BT_PUT(notif); } if (dummy->iterators->len == 0) { -- 2.34.1