Make bt_private_connection_create_notification_iterator() return a status code
[babeltrace.git] / plugins / utils / dummy / dummy.c
index 3d7de4d50cf89960917a5d1c50f013cf046e5597..c3434a59929b8f1c6b2d71d4f8cd7405f9d8de77 100644 (file)
  */
 
 #include <babeltrace/plugin/plugin-dev.h>
+#include <babeltrace/graph/connection.h>
 #include <babeltrace/graph/component.h>
 #include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/private-component-sink.h>
 #include <babeltrace/graph/private-port.h>
 #include <babeltrace/graph/port.h>
 #include <babeltrace/graph/private-connection.h>
@@ -64,6 +66,12 @@ enum bt_component_status dummy_init(struct bt_private_component *component,
                goto end;
        }
 
+       ret = bt_private_component_sink_add_input_private_port(component,
+               "in", NULL, NULL);
+       if (ret != BT_COMPONENT_STATUS_OK) {
+               goto end;
+       }
+
        dummy->iterators = g_ptr_array_new_with_free_func(
                        (GDestroyNotify) bt_put);
        if (!dummy->iterators) {
@@ -90,14 +98,15 @@ void dummy_port_connected(
        struct dummy *dummy;
        struct bt_notification_iterator *iterator;
        struct bt_private_connection *connection;
+       enum bt_connection_status conn_status;
 
        dummy = bt_private_component_get_user_data(component);
        assert(dummy);
        connection = bt_private_port_get_private_connection(self_port);
        assert(connection);
-       iterator = bt_private_connection_create_notification_iterator(
-               connection);
-       if (!iterator) {
+       conn_status = bt_private_connection_create_notification_iterator(
+               connection, NULL, &iterator);
+       if (conn_status != BT_CONNECTION_STATUS_OK) {
                dummy->error = true;
                goto end;
        }
This page took 0.040938 seconds and 4 git commands to generate.