diff options
| author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-09 21:01:05 +0000 |
|---|---|---|
| committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-09 21:01:05 +0000 |
| commit | d7d01bdc5c667a1fafd95241282b58e03b4caa5b (patch) | |
| tree | f1482d8734da609923c6d8af6bc8fcb0fc187534 /src/modulemanager.cpp | |
| parent | d49b3a25fda5f597491e73640dd1e76babc240eb (diff) | |
Squashed commit: merge next (1.9.1) back to trunk.
SVN users, NOTE: THIS WILL NOT BUILD, NOR SHOULD YOU RUN IT YET.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1953 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modulemanager.cpp')
| -rw-r--r-- | src/modulemanager.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp index 6a995f41f..5354e4755 100644 --- a/src/modulemanager.cpp +++ b/src/modulemanager.cpp @@ -170,19 +170,19 @@ int ModuleManager::LoadModule(const std::string &modname, User * u) ano_modclearerr(); - ano_module_t handle = ano_modopen(pbuf.c_str()); - if (handle == NULL && (err = ano_moderr()) != NULL) + ano_module_t handle = dlopen(pbuf.c_str(), RTLD_LAZY); + if (handle == NULL && (err = dlerror()) != NULL) { alog("%s", err); return MOD_ERR_NOLOAD; } ano_modclearerr(); - func = function_cast<Module *(*)(const std::string &)>(ano_modsym(handle, "init_module")); - if (func == NULL && (err = ano_moderr()) != NULL) + func = function_cast<Module *(*)(const std::string &)>(dlsym(handle, "init_module")); + if (func == NULL && (err = dlerror()) != NULL) { alog("No magical init function found, not an Anope module"); - ano_modclose(handle); + dlclose(handle); return MOD_ERR_NOLOAD; } @@ -275,8 +275,8 @@ void ModuleManager::DeleteModule(Module *m) handle = m->handle; ano_modclearerr(); - destroy_func = function_cast<void (*)(Module *)>(ano_modsym(m->handle, "destroy_module")); - if (destroy_func == NULL && (err = ano_moderr()) != NULL) + destroy_func = function_cast<void (*)(Module *)>(dlsym(m->handle, "destroy_module")); + if (destroy_func == NULL && (err = dlerror()) != NULL) { alog("No magical destroy function found, chancing delete..."); delete m; /* we just have to chance they haven't overwrote the delete operator then... */ @@ -288,7 +288,7 @@ void ModuleManager::DeleteModule(Module *m) if (handle) { - if ((ano_modclose(handle)) != 0) - alog("%s", ano_moderr()); + if ((dlclose(handle)) != 0) + alog("%s", dlerror()); } } |
