Skip to content

Commit

Permalink
Use RCL_RET_* codes only. (#686)
Browse files Browse the repository at this point in the history
Also, update documentation.

Signed-off-by: Michel Hidalgo <[email protected]>
  • Loading branch information
hidmic authored Jun 16, 2020
1 parent 7723308 commit b7dbb3e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions rcl/include/rcl/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ extern "C"
* \return `RCL_RET_OK` if initialization is successful, or
* \return `RCL_RET_ALREADY_INIT` if rcl_init has already been called, or
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
* \return `RCL_RET_INVALID_ROS_ARGS` if an invalid ROS argument is found, or
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
* \return `RCL_RET_ERROR` if an unspecified error occurs.
*/
Expand Down
6 changes: 3 additions & 3 deletions rcl/src/rcl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ rcl_init(
"Enclave name is not valid: '%s'. Invalid index: %zu",
rcl_enclave_name_validation_result_string(validation_result),
invalid_index);
fail_ret = RMW_RET_ERROR;
fail_ret = RCL_RET_ERROR;
goto fail;
}

if (!context->impl->init_options.impl->rmw_init_options.enclave) {
RCL_SET_ERROR_MSG("failed to set context name");
fail_ret = RMW_RET_BAD_ALLOC;
fail_ret = RCL_RET_BAD_ALLOC;
goto fail;
}

Expand All @@ -204,7 +204,7 @@ rcl_init(
context->impl->init_options.impl->rmw_init_options.enclave,
&context->impl->allocator,
security_options);
if (RMW_RET_OK != ret) {
if (RCL_RET_OK != ret) {
fail_ret = ret;
goto fail;
}
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/publisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ rcl_publish_serialized_message(
if (ret == RMW_RET_BAD_ALLOC) {
return RCL_RET_BAD_ALLOC;
}
return RMW_RET_ERROR;
return RCL_RET_ERROR;
}
return RCL_RET_OK;
}
Expand Down
2 changes: 1 addition & 1 deletion rcl/src/rcl/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ rcl_get_security_options_from_environment(

if (!use_security) {
security_options->enforce_security = RMW_SECURITY_ENFORCEMENT_PERMISSIVE;
return RMW_RET_OK;
return RCL_RET_OK;
}

ret = rcl_get_enforcement_policy(&security_options->enforce_security);
Expand Down

0 comments on commit b7dbb3e

Please sign in to comment.