PengZheng commented on code in PR #476:
URL: https://github.com/apache/celix/pull/476#discussion_r1116925048


##########
libs/framework/src/celix_libloader.c:
##########
@@ -34,13 +33,20 @@ celix_library_handle_t* 
celix_libloader_open(celix_bundle_context_t *ctx, const
     if (noDelete) {
         flags = RTLD_LAZY|RTLD_LOCAL|RTLD_NODELETE;
     }
+
     handle = dlopen(libPath, flags);
+    if (handle == NULL) {
+        celix_bundleContext_log(ctx, CELIX_LOG_LEVEL_ERROR, "Cannot open 
library: %s, error: %s", libPath, dlerror());

Review Comment:
   I'm surprised to learn that `dlerror` on Linux and macOS is indeed 
thread-safe, but not on all platforms.
   In the past, I tended to avoid its use thinking it thread-unsafe.
   
   https://austin-group-l.opengroup.narkive.com/JI4xEbeU/thread-safe-dlerror



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to