You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/11/20 03:13:01 UTC

[GitHub] [geode-native] pivotal-jbarrett commented on a change in pull request #700: GEODE-8735: Change factory logic for symbols lookup

pivotal-jbarrett commented on a change in pull request #700:
URL: https://github.com/apache/geode-native/pull/700#discussion_r527365312



##########
File path: cppcache/src/Utils.cpp
##########
@@ -173,20 +174,22 @@ const boost::dll::shared_library& getSharedLibrary(
 
   const auto& find = sharedLibraries.find(libraryName);
   if (find == sharedLibraries.end()) {
+    auto path = libraryName.empty() ? boost::dll::program_location()

Review comment:
       Great timing for me merging the boost::dll changes the other day. This change looks pretty straight forward!

##########
File path: cppcache/src/Utils.cpp
##########
@@ -173,20 +174,22 @@ const boost::dll::shared_library& getSharedLibrary(
 
   const auto& find = sharedLibraries.find(libraryName);
   if (find == sharedLibraries.end()) {
+    auto path = libraryName.empty() ? boost::dll::program_location()
+                                    : boost::dll::fs::path{libraryName};
     try {
       return *sharedLibraries
                   .emplace(
                       libraryName,
                       std::make_shared<boost::dll::shared_library>(
-                          libraryName,
+                          path,
                           boost::dll::load_mode::rtld_global |
                               boost::dll::load_mode::rtld_lazy |
                               boost::dll::load_mode::append_decorations |
                               boost::dll::load_mode::search_system_folders))
                   .first->second;
     } catch (const boost::dll::fs::system_error& e) {
-      throw IllegalArgumentException("cannot open library: " + libraryName +
-                                     ": reason: " + e.what());
+      throw IllegalArgumentException("cannot open library: \"" + libraryName +

Review comment:
       I wonder if path makes more sense here now? Can the `shared_library` construction fail ever in the case of `program_location`?




----------------------------------------------------------------
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.

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