X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Fgraph%2Fgraph.h;h=ef847361e16dcd352b10abf12f3444bedcb6afb1;hb=870631a2db01676b476dbee615aade0a22926bcd;hp=30d59fb9d7e40eac63634884d7f8a7df8f21b956;hpb=3cd4c495b8c065ababc249f66d460c4a707d415a;p=babeltrace.git diff --git a/src/lib/graph/graph.h b/src/lib/graph/graph.h index 30d59fb9..ef847361 100644 --- a/src/lib/graph/graph.h +++ b/src/lib/graph/graph.h @@ -24,6 +24,11 @@ * SOFTWARE. */ +/* Protection: this file uses BT_LIB_LOG*() macros directly */ +#ifndef BT_LIB_LOG_SUPPORTED +# error Please include "lib/logging.h" before including this file. +#endif + #include #include #include "common/macros.h" @@ -246,13 +251,18 @@ int bt_graph_configure(struct bt_graph *graph) comp_status == BT_FUNC_STATUS_MEMORY_ERROR, "Unexpected returned status: status=%s", bt_common_func_status_string(comp_status)); - if (comp_status != BT_FUNC_STATUS_OK) { - status = BT_FUNC_STATUS_ERROR; - BT_LIB_LOGW("User's \"graph is configured\" method failed: " - "%![comp-]+c, status=%s", - comp, bt_common_func_status_string( - comp_status)); + comp_status = BT_FUNC_STATUS_ERROR; + if (comp_status < 0) { + BT_LIB_LOGW_APPEND_CAUSE( + "Component's \"graph is configured\" method failed: " + "%![comp-]+c, status=%s", + comp, + bt_common_func_status_string( + comp_status)); + } + + status = comp_status; goto end; } }