From 76363f9ba23460a7724928cb64352ebbdc8f03b7 Mon Sep 17 00:00:00 2001 From: Yadunund Date: Wed, 17 Jul 2024 07:49:38 +0800 Subject: [PATCH] Fix return in rmw_init Signed-off-by: Yadunund --- rmw_zenoh_cpp/src/rmw_init.cpp | 7 ++++--- rmw_zenoh_cpp/src/zenohd/main.cpp | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/rmw_zenoh_cpp/src/rmw_init.cpp b/rmw_zenoh_cpp/src/rmw_init.cpp index 303347b0..99c6f3ad 100644 --- a/rmw_zenoh_cpp/src/rmw_init.cpp +++ b/rmw_zenoh_cpp/src/rmw_init.cpp @@ -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. diff --git a/rmw_zenoh_cpp/src/zenohd/main.cpp b/rmw_zenoh_cpp/src/zenohd/main.cpp index 71c87876..fd749d4b 100644 --- a/rmw_zenoh_cpp/src/zenohd/main.cpp +++ b/rmw_zenoh_cpp/src/zenohd/main.cpp @@ -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;