+ err = NULL;
+
+ if (!strstr(fname,".so"))
+ {
+ err = "This doesn't look like a module file to me...";
+ return;
+ }
+#ifdef STATIC_LINK
+ this->staticname[0] = '\0';
+ ServerInstance->Log(DEBUG,"Loading core-compiled module '%s'",fname);
+ for (int j = 0; modsyms[j].name; j++)
+ {
+ ServerInstance->Log(DEBUG,"Check %s",modsyms[j].name);
+ if (!strcmp(modsyms[j].name,fname))
+ {
+ ServerInstance->Log(DEBUG,"Found %s",fname);
+ strlcpy(this->staticname,fname,1020);
+ err = 0;
+ return;
+ }
+ }
+ err = "Module is not statically compiled into the ircd";
+#else
+ h = dlopen(fname, RTLD_NOW|RTLD_LOCAL);
+ if (!h)
+ {
+ err = (char*)dlerror();
+ ServerInstance->Log(DEBUG,"dlerror '%s' occured!", err);
+ return;
+ }
+
+ ServerInstance->Log(DEBUG,"Finished loading '%s': %0x", fname, h);
+#endif