Skip to content

Commit

Permalink
lib: append error in simple_sink_consume only if error status
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
simark authored and jgalar committed Nov 14, 2019
1 parent c7d8bfa commit eb657c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/graph/component-class-sink-simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit eb657c7

Please sign in to comment.