lib: append error in simple_sink_consume only if error status
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 8 Nov 2019 19:03:56 +0000 (14:03 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 14 Nov 2019 22:49:46 +0000 (17:49 -0500)
If the consume_func returns _AGAIN, we will append an error cause.  That
is wrong because _AGAIN is not an error cause.  Check for negative
status values instead of just != OK.

Change-Id: Ibc03a1e9eb25de5ec39af5148c8e235498c57b64
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2358
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/lib/graph/component-class-sink-simple.c

index 8a4aba536d9d97aa787cae2d5da6404244859548..b347280f7a8588b573c52d8bd8df097fc08eee1d 100644 (file)
@@ -178,7 +178,7 @@ enum bt_component_class_sink_consume_method_status simple_sink_consume(
        /* Call user's "consume" function */
        status = data->init_method_data.consume_func(data->msg_iter,
                data->init_method_data.user_data);
-       if (status != BT_FUNC_STATUS_OK) {
+       if (status < 0) {
                BT_LIB_LOGW_APPEND_CAUSE(
                        "Simple sink component's user's \"consume\" function failed: "
                        "status=%s, %![comp-]+c",
This page took 0.026568 seconds and 4 git commands to generate.