X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Fgraph%2Fgraph.c;h=219ca277ae6a197ea4d2e604cd9730db35745ac4;hb=cd6128ca5412c3b9cb40afe2580008329f612930;hp=b7d04b0a674b2d8fb44aa7659e9bc44e440206ca;hpb=0d47d31b29a40292ae11215ca77555a3deec3126;p=babeltrace.git diff --git a/lib/graph/graph.c b/lib/graph/graph.c index b7d04b0a..219ca277 100644 --- a/lib/graph/graph.c +++ b/lib/graph/graph.c @@ -82,6 +82,9 @@ struct bt_graph_listener_ports_connected { do { \ size_t i; \ \ + if (!_listeners) { \ + break; \ + } \ for (i = 0; i < (_listeners)->len; i++) { \ _type *listener = \ &g_array_index((_listeners), _type, i); \ @@ -688,7 +691,7 @@ enum bt_graph_status bt_graph_consume(struct bt_graph *graph) "Graph is in a faulty state: %!+g", graph); bt_graph_set_can_consume(graph, false); status = bt_graph_configure(graph); - if (status) { + if (unlikely(status)) { /* bt_graph_configure() logs errors */ goto end; } @@ -712,7 +715,7 @@ enum bt_graph_status bt_graph_run(struct bt_graph *graph) "Graph is in a faulty state: %!+g", graph); bt_graph_set_can_consume(graph, false); status = bt_graph_configure(graph); - if (status) { + if (unlikely(status)) { /* bt_graph_configure() logs errors */ goto end; } @@ -749,8 +752,6 @@ enum bt_graph_status bt_graph_run(struct bt_graph *graph) if (graph->sinks_to_consume->length > 1) { status = BT_GRAPH_STATUS_OK; } - } else if (status == BT_GRAPH_STATUS_NO_SINK) { - goto end; } } while (status == BT_GRAPH_STATUS_OK);