From: Philippe Proulx Date: Mon, 24 Apr 2017 20:30:01 +0000 (-0400) Subject: utils.dummy: handle AGAIN and END statuses correctly X-Git-Tag: v2.0.0-pre1~355 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=8812600c6eff8ee50966d685a7922e797ce97610;p=babeltrace.git utils.dummy: handle AGAIN and END statuses correctly Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- 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) {