From: Jérémie Galarneau Date: Thu, 25 Feb 2016 17:30:28 +0000 (-0500) Subject: Register sink components to the event notification by default X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=9e9504c7cd7786da6cf8bad54f4e5f63715bdf50;p=deliverable%2Fbabeltrace.git Register sink components to the event notification by default Signed-off-by: Jérémie Galarneau --- diff --git a/lib/plugin-system/sink.c b/lib/plugin-system/sink.c index 4f705a001..c1d1df066 100644 --- a/lib/plugin-system/sink.c +++ b/lib/plugin-system/sink.c @@ -69,13 +69,22 @@ struct bt_component *bt_component_sink_create( goto end; } - ret = bt_component_init(&sink->parent, bt_component_sink_destroy); + sink->parent.class = bt_get(class); + ret = bt_component_init(&sink->parent, NULL); if (ret != BT_COMPONENT_STATUS_OK) { - BT_PUT(sink); - goto end; + goto error; + } + + ret = bt_component_sink_register_notification_type(&sink->parent, + BT_NOTIFICATION_TYPE_EVENT); + if (ret != BT_COMPONENT_STATUS_OK) { + goto error; } end: return sink ? &sink->parent : NULL; +error: + BT_PUT(sink); + return NULL; } enum bt_component_status bt_component_sink_handle_notification(