utils.dummy: handle AGAIN and END statuses correctly
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 24 Apr 2017 20:30:01 +0000 (16:30 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:41 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/utils/dummy/dummy.c

index 01782859c55e61a6de66f073a1709b2ba7e0987d..3d7de4d50cf89960917a5d1c50f013cf046e5597 100644 (file)
@@ -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) {
This page took 0.026036 seconds and 4 git commands to generate.