lib: make can_seek_beginning and can_seek_ns_from_origin methods return a status
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 6 Sep 2019 19:50:51 +0000 (15:50 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 17 Sep 2019 19:05:53 +0000 (15:05 -0400)
commitf2fb1b3297ca0bc13b53189a063b63944be7fae9
treed6f91d9d2112ef28a043ae377fea503dbeb0234c
parent0a6d7302f774fbd35d7439889734acd418e8ef14
lib: make can_seek_beginning and can_seek_ns_from_origin methods return a status

The current situation is problematic: calling any of these methods on a
message iterator can result in running some user code, which can fail
for various reasons (e.g. any Python exception being raised and
escaping).  It is not possible to inform the caller of such failure, as
the return type of these methods is bt_bool.  This must change.

This patch changes them to return a status, and return the result by an
output parameter.

If the method returns OK, it must have set the output parameter to
BT_TRUE or BT_FALSE.  If it returns another status, the output parameter
value is unused.

Change-Id: Iaa3dcc1494e2a0fcbdbb14283af3bf8504cd8ef5
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2012
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
19 files changed:
include/babeltrace2/graph/component-class-filter.h
include/babeltrace2/graph/component-class-source.h
include/babeltrace2/graph/component-class.h
include/babeltrace2/graph/message-iterator.h
include/babeltrace2/graph/self-component-port-input-message-iterator.h
src/bindings/python/bt2/bt2/message_iterator.py
src/bindings/python/bt2/bt2/native_bt.i
src/bindings/python/bt2/bt2/native_bt_component_class.i.h
src/bindings/python/bt2/bt2/native_bt_log_and_append_error.h
src/lib/graph/iterator.c
src/lib/graph/message/iterator.h
src/plugins/lttng-utils/debug-info/debug-info.c
src/plugins/lttng-utils/debug-info/debug-info.h
src/plugins/text/dmesg/dmesg.c
src/plugins/text/dmesg/dmesg.h
src/plugins/utils/muxer/muxer.c
src/plugins/utils/muxer/muxer.h
src/plugins/utils/trimmer/trimmer.c
tests/bindings/python/bt2/test_message_iterator.py
This page took 0.028438 seconds and 4 git commands to generate.