diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-07 20:12:24 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-07 20:12:24 +0000 |
commit | 1ff199172d2fd4fa8e7f29dbffd10c684e25e3a9 (patch) | |
tree | 7af12cf8f4bf7072d676db294196d065f084f76d /src/inspircd.cpp | |
parent | 8a21bfcb21094e4ca8440c37dec4a5df3e5bddc7 (diff) |
Added some hax :( to prevent invalid symbols. It seems that instead of returning NULL, its setting a pointer to -1
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4770 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 3ce2261c5..79435ea58 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -586,18 +586,21 @@ bool InspIRCd::LoadModule(const char* filename) return false; } } - ircd_module* a = new ircd_module(modfile); - factory[MODCOUNT+1] = a; - if (factory[MODCOUNT+1]->LastError()) - { - log(DEFAULT,"Unable to load %s: %s",modfile,factory[MODCOUNT+1]->LastError()); - snprintf(MODERR,MAXBUF,"Loader/Linker error: %s",factory[MODCOUNT+1]->LastError()); - return false; - } try { - if (factory[MODCOUNT+1]->factory) + ircd_module* a = new ircd_module(modfile); + log(DEBUG,"ircd_module constructor success, MODCOUNT %d",MODCOUNT); + factory[MODCOUNT+1] = a; + if (factory[MODCOUNT+1]->LastError()) + { + log(DEFAULT,"Unable to load %s: %s",modfile,factory[MODCOUNT+1]->LastError()); + snprintf(MODERR,MAXBUF,"Loader/Linker error: %s",factory[MODCOUNT+1]->LastError()); + return false; + } + log(DEBUG,"No last error"); + if ((int)factory[MODCOUNT+1]->factory != -1) { + log(DEBUG,"Factory ptr: %0x",&factory[MODCOUNT+1]->factory); Module* m = factory[MODCOUNT+1]->factory->CreateModule(MyServer); modules[MODCOUNT+1] = m; /* save the module and the module's classfactory, if @@ -616,7 +619,7 @@ bool InspIRCd::LoadModule(const char* filename) else { log(DEFAULT,"Unable to load %s",modfile); - snprintf(MODERR,MAXBUF,"Factory function failed!"); + snprintf(MODERR,MAXBUF,"Factory function failed: Probably missing init_module() entrypoint."); return false; } } |