Skip to content

Commit

Permalink
Fix return in rmw_init
Browse files Browse the repository at this point in the history
Signed-off-by: Yadunund <[email protected]>
  • Loading branch information
Yadunund committed Jul 16, 2024
1 parent 22fbbf1 commit 76363f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions rmw_zenoh_cpp/src/rmw_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,12 @@ rmw_init(const rmw_init_options_t * options, rmw_context_t * context)
// Initialize context's implementation
context->impl->is_shutdown = false;

// If not already defined, set the logging environment variable for Zenoh
// to warning level by default
// If not already defined, set the logging environment variable for Zenoh sessions
// to warning level by default.
// TODO(Yadunund): Switch to rcutils_get_env once it supports not overwriting values.
if (setenv(ZENOH_LOG_ENV_VAR_STR, ZENOH_LOG_WARN_LEVEL_STR, 0) != 0) {
RMW_SET_ERROR_MSG("Error configuring Zenoh logging.");
return 1;
return RMW_RET_ERROR;
}

// Initialize the zenoh configuration.
Expand Down
5 changes: 3 additions & 2 deletions rmw_zenoh_cpp/src/zenohd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ int main(int argc, char ** argv)
(void)argc;
(void)argv;

// If not already defined, set the logging environment variable for Zenoh
// to info level by default
// If not already defined, set the logging environment variable for Zenoh router
// to info level by default.
// TODO(Yadunund): Switch to rcutils_get_env once it supports not overwriting values.
if (setenv(ZENOH_LOG_ENV_VAR_STR, ZENOH_LOG_INFO_LEVEL_STR, 0) != 0) {
RMW_SET_ERROR_MSG("Error configuring Zenoh logging.");
return 1;
Expand Down

0 comments on commit 76363f9

Please sign in to comment.