Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Karsten1987 committed Jun 13, 2018
1 parent cdf134c commit 79197d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rcl/src/rcl/publisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,13 @@ rcl_publish_raw(const rcl_publisher_t * publisher, const rcl_message_raw_t * raw
if (!rcl_publisher_is_valid(publisher, NULL)) {
return RCL_RET_PUBLISHER_INVALID;
}
if (rmw_publish_raw(publisher->impl->rmw_handle, raw_message) != RMW_RET_OK) {
rmw_ret_t ret = rmw_publish_raw(publisher->impl->rmw_handle, raw_message);
if (ret != RMW_RET_OK) {
RCL_SET_ERROR_MSG(rmw_get_error_string_safe(), rcl_get_default_allocator());
return RCL_RET_ERROR;
if (ret == RMW_RET_BAD_ALLOC) {
return RCL_RET_BAD_ALLOC;
}
return RMW_RET_ERROR;
}
return RCL_RET_OK;
}
Expand Down
3 changes: 3 additions & 0 deletions rcl/src/rcl/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ rcl_take_raw(
rmw_take_raw_with_info(subscription->impl->rmw_handle, raw_message, &taken, message_info_local);
if (ret != RMW_RET_OK) {
RCL_SET_ERROR_MSG(rmw_get_error_string_safe(), error_allocator);
if (ret == RMW_RET_BAD_ALLOC) {
return RCL_RET_BAD_ALLOC;
}
return RCL_RET_ERROR;
}
RCUTILS_LOG_DEBUG_NAMED(
Expand Down

0 comments on commit 79197d1

Please sign in to comment.