lib: remove `BT_GRAPH_RUN_STATUS_END`
[babeltrace.git] / src / lib / graph / graph.c
index 44a5e1b4d657d98de328859f0df095734ea42e6b..ed66ba89ef5c2c13d1629c6421aa16ef5db80fa5 100644 (file)
@@ -773,8 +773,15 @@ enum bt_graph_run_status bt_graph_run(struct bt_graph *graph)
                }
        } while (status == BT_FUNC_STATUS_OK);
 
-       if (g_queue_is_empty(graph->sinks_to_consume)) {
-               status = BT_FUNC_STATUS_END;
+       if (status == BT_FUNC_STATUS_END) {
+               /*
+                * The last call to consume_no_check() returned
+                * `BT_FUNC_STATUS_END`, but bt_graph_run() has no
+                * `BT_GRAPH_RUN_STATUS_END` status: replace with
+                * `BT_GRAPH_RUN_STATUS_OK` (success: graph ran
+                * completely).
+                */
+               status = BT_FUNC_STATUS_OK;
        }
 
 end:
This page took 0.023989 seconds and 4 git commands to generate.