From: Francis Deslauriers Date: Mon, 1 Apr 2019 13:58:02 +0000 (-0400) Subject: graph: Fix: bt_graph_configure() does not propagate errors X-Git-Tag: v2.0.0-pre5~72 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=025502dfade7bc21beaf8f0bd0eff6c11e1fa3a8 graph: Fix: bt_graph_configure() does not propagate errors Issue ===== When configuring the graph, message iterator initialize functions may fail and return an error status (e.g. _STATUS_NOMEM and _STATUS_ERROR). Those error status are not propagated back to the caller of `bt_graph_configure()` function. The caller that will consider the graph to be configured properly and run it will it assertions down the road. Solution ======== Return `BT_GRAPH_STATUS_ERROR` if any of the sinks returned a non-OK status from its `graph_is_configured()` function. Known drawbacks =============== None. Signed-off-by: Francis Deslauriers --- diff --git a/include/babeltrace/graph/graph-internal.h b/include/babeltrace/graph/graph-internal.h index 83812e7b..ec2f65ec 100644 --- a/include/babeltrace/graph/graph-internal.h +++ b/include/babeltrace/graph/graph-internal.h @@ -261,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",