]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/dynamic.cpp
Fall back to copying bind IP if getsockname() fails, as it apparently can on Windows
[user/henk/code/inspircd.git] / src / dynamic.cpp
index 637a57db4552c7d6c415ee5e44a1aca24335e590..ebaaa5191ace59dd337ff18faf8834def42a0203 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -26,7 +26,7 @@ DLLManager::DLLManager(const char *fname)
                return;
        }
 
-       h = dlopen(fname, RTLD_NOW|RTLD_LOCAL|RTLD_NODELETE);
+       h = dlopen(fname, RTLD_NOW|RTLD_LOCAL);
        if (!h)
        {
                err = dlerror();
@@ -45,7 +45,7 @@ union init_t {
        Module* (*fptr)();
 };
 
-Module* DLLManager::callInit()
+Module* DLLManager::CallInit()
 {
        if (!h)
                return NULL;
@@ -60,3 +60,14 @@ Module* DLLManager::callInit()
 
        return (*initfn.fptr)();
 }
+
+std::string DLLManager::GetVersion()
+{
+       if (!h)
+               return "";
+
+       const char* srcver = (char*)dlsym(h, "inspircd_src_version");
+       if (srcver)
+               return srcver;
+       return "Unversioned module";
+}