graph: Fix: bt_graph_configure() does not propagate errors
[babeltrace.git] / include / babeltrace / graph / graph-internal.h
index 97289cf0f168e4b36d349845a5b0de199e46e34f..ec2f65ecff9d2afd55ab548f84b2f539a4991530 100644 (file)
@@ -43,6 +43,7 @@ enum bt_graph_configuration_state {
        BT_GRAPH_CONFIGURATION_STATE_CONFIGURING,
        BT_GRAPH_CONFIGURATION_STATE_PARTIALLY_CONFIGURED,
        BT_GRAPH_CONFIGURATION_STATE_CONFIGURED,
+       BT_GRAPH_CONFIGURATION_STATE_FAULTY,
 };
 
 struct bt_graph {
@@ -211,6 +212,8 @@ enum bt_graph_status bt_graph_configure(struct bt_graph *graph)
        enum bt_graph_status status = BT_GRAPH_STATUS_OK;
        uint64_t i;
 
+       BT_ASSERT(graph->config_state != BT_GRAPH_CONFIGURATION_STATE_FAULTY);
+
        if (likely(graph->config_state ==
                        BT_GRAPH_CONFIGURATION_STATE_CONFIGURED)) {
                goto end;
@@ -258,6 +261,7 @@ enum bt_graph_status bt_graph_configure(struct bt_graph *graph)
 #endif
 
                        if (comp_status != BT_SELF_COMPONENT_STATUS_OK) {
+                               status = BT_GRAPH_STATUS_ERROR;
 #ifdef BT_LIB_LOGW
                                BT_LIB_LOGW("User's \"graph is configured\" method failed: "
                                        "%![comp-]+c, status=%s",
This page took 0.023213 seconds and 4 git commands to generate.