Fix: src.ctf.lttng-live: return correct error status in lttng_live_msg_iter_init
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 31 Jan 2022 15:38:11 +0000 (10:38 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 16 Feb 2022 19:16:46 +0000 (14:16 -0500)
commit10265ebe457aa6633556c604e27e865e66d14f0b
tree736019f800e94bbb3a77c74bb941ca78e79a60c2
parentaac10c5d685a31ceeec5600a0f39b7f4a415ab18
Fix: src.ctf.lttng-live: return correct error status in lttng_live_msg_iter_init

Fix this clang-tidy warning:

    /home/simark/src/babeltrace/src/plugins/ctf/lttng-live/lttng-live.cpp:1802:9: warning: Value stored to 'status' is never read [clang-analyzer-deadcode.DeadStores]
            status = BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR;
            ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Indeed, we set status to MEMORY_ERROR here, but overwrite it to ERROR at
the error label.  Remove the assignment at the error label, add
assignments to all points where we go to the error label.

Change-Id: I5a81210609d913854f7b7d1b1be5bd54fffa02b2
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7195
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/ctf/lttng-live/lttng-live.cpp
This page took 0.024707 seconds and 4 git commands to generate.