#include <babeltrace2/value-const.h>
#include "lib/value.h"
#include <unistd.h>
+#include <stdbool.h>
#include <glib.h>
#include "component-class-sink-simple.h"
}
} 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: