Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to build against Fast DDS 3.0 #776

Merged
merged 13 commits into from
Jan 22, 2025
Prev Previous commit
Next Next commit
Correctly check returned values from writer loans APIs.
Signed-off-by: Mario Dominguez <[email protected]>
  • Loading branch information
Mario-DL authored and MiguelCompany committed Jan 22, 2025
commit c9a200a1440beb2f41d0f9b8d2e269c3134a3bdf
4 changes: 2 additions & 2 deletions rmw_fastrtps_shared_cpp/src/rmw_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ __rmw_borrow_loaned_message(
}

auto info = static_cast<CustomPublisherInfo *>(publisher->data);
if (!info->data_writer_->loan_sample(*ros_message)) {
if (eprosima::fastdds::dds::RETCODE_OK != info->data_writer_->loan_sample(*ros_message)) {
return RMW_RET_ERROR;
}

Expand All @@ -202,7 +202,7 @@ __rmw_return_loaned_message_from_publisher(
RMW_CHECK_ARGUMENT_FOR_NULL(loaned_message, RMW_RET_INVALID_ARGUMENT);

auto info = static_cast<CustomPublisherInfo *>(publisher->data);
if (!info->data_writer_->discard_loan(loaned_message)) {
if (eprosima::fastdds::dds::RETCODE_OK != info->data_writer_->discard_loan(loaned_message)) {
return RMW_RET_ERROR;
}

Expand Down
3 changes: 2 additions & 1 deletion rmw_fastrtps_shared_cpp/src/rmw_take.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,8 @@ __rmw_return_loaned_message_from_subscription(
std::unique_ptr<rmw_fastrtps_shared_cpp::LoanManager::Item> item;
item = info->loan_manager_->erase_item(loaned_message);
if (item != nullptr) {
if (!info->data_reader_->return_loan(item->data_seq, item->info_seq)) {
auto ret_code = info->data_reader_->return_loan(item->data_seq, item->info_seq);
if (eprosima::fastdds::dds::RETCODE_OK != ret_code) {
RMW_SET_ERROR_MSG("Error returning loan");
return RMW_RET_ERROR;
}
Expand Down