When bt_clock_snapshot_get_ns_from_origin is called in
clock_snapshots_are_monotonic_one, it can return OVERFLOW_ERROR, in
which case it also sets the current thread error.
clock_snapshots_are_monotonic_one doesn't report an error status to its
caller (it's not its goal), so it should not leave the error there.
This is exercised when running Python test
ClockSnapshotTestCase.test_clock_class.
Change-Id: I0f15c2607c299fabc3a89e6a292d97d8d5815fc4
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2360
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
goto end;
}
- clock_snapshot_status = bt_clock_snapshot_get_ns_from_origin(clock_snapshot, &ns_from_origin);
+ clock_snapshot_status = bt_clock_snapshot_get_ns_from_origin(
+ clock_snapshot, &ns_from_origin);
if (clock_snapshot_status != BT_FUNC_STATUS_OK) {
+ /*
+ * bt_clock_snapshot_get_ns_from_origin can return
+ * OVERFLOW_ERROR. We don't really want to report an error to
+ * our caller, so just clear it.
+ */
+ bt_current_thread_clear_error();
goto end;
}