mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 02:18:04 +01:00
backport SharedLibrary changes from 1.4.2-p1
This commit is contained in:
@@ -62,16 +62,17 @@ SharedLibraryImpl::~SharedLibraryImpl()
|
||||
}
|
||||
|
||||
|
||||
void SharedLibraryImpl::loadImpl(const std::string& path)
|
||||
void SharedLibraryImpl::loadImpl(const std::string& path, int flags)
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
if (_handle) throw LibraryAlreadyLoadedException(path);
|
||||
int flags = RTLD_LAZY | RTLD_GLOBAL;
|
||||
#if defined(RTLD_DEEPBIND)
|
||||
flags |= RTLD_DEEPBIND;
|
||||
#endif
|
||||
_handle = dlopen(path.c_str(), flags);
|
||||
int realFlags = RTLD_LAZY;
|
||||
if (flags & SHLIB_LOCAL_IMPL)
|
||||
realFlags |= RTLD_LOCAL;
|
||||
else
|
||||
realFlags |= RTLD_GLOBAL;
|
||||
_handle = dlopen(path.c_str(), realFlags);
|
||||
if (!_handle)
|
||||
{
|
||||
const char* err = dlerror();
|
||||
|
||||
Reference in New Issue
Block a user