Browse Source

[master] fix 'unrecognized exception' problem

use RTLD_GLOBAL when opening modules, otherwise the exceptions some methods raise may not be recognized in catches
Jelte Jansen 13 years ago
parent
commit
0e4960761e
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/lib/datasrc/factory.cc

+ 3 - 1
src/lib/datasrc/factory.cc

@@ -30,7 +30,9 @@ namespace isc {
 namespace datasrc {
 namespace datasrc {
 
 
 LibraryContainer::LibraryContainer(const std::string& name) {
 LibraryContainer::LibraryContainer(const std::string& name) {
-    ds_lib_ = dlopen(name.c_str(), RTLD_NOW | RTLD_LOCAL);
+    // use RTLD_GLOBAL so that shared symbols (e.g. exceptions)
+    // are recognized as such
+    ds_lib_ = dlopen(name.c_str(), RTLD_NOW | RTLD_GLOBAL);
     if (ds_lib_ == NULL) {
     if (ds_lib_ == NULL) {
         isc_throw(DataSourceLibraryError, dlerror());
         isc_throw(DataSourceLibraryError, dlerror());
     }
     }