Cleanup: add `#include <stdbool.h>` whenever `bool` type is used
[babeltrace.git] / src / lib / graph / graph.c
index 44a5e1b4d657d98de328859f0df095734ea42e6b..4cdb06c1c474f8eb7c6822b5d5e36f8dd7e010ca 100644 (file)
@@ -40,6 +40,7 @@
 #include <babeltrace2/value-const.h>
 #include "lib/value.h"
 #include <unistd.h>
+#include <stdbool.h>
 #include <glib.h>
 
 #include "component-class-sink-simple.h"
@@ -773,8 +774,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.02441 seconds and 4 git commands to generate.