summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-12 12:29:40 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-12 12:29:40 +0000
commitb81c2e4c4eda2c7ae6fa5fbccfe40c94852fdf3b (patch)
tree0018baf9ca6ebbd0b54f406c60b563763a81ed98 /src/inspircd.cpp
parent1582c2d1c54fedb39869d9632f77f848e62cd55e (diff)
More experimental gubbins
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2330 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 01cf4f392..76c091cac 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -2560,22 +2560,6 @@ int InspIRCd(char** argv, int argc)
log(DEBUG,"InspIRCd: startup: read %lu total client ports",(unsigned long)portCount);
printf("\n");
-
- /* BugFix By Craig! :p */
- MODCOUNT = -1;
- for (count = 0; count < ConfValueEnum("module",&config_f); count++)
- {
- ConfValue("module","name",count,configToken,&config_f);
- printf("Loading module... \033[1;32m%s\033[0m\n",configToken);
- if (!LoadModule(configToken))
- {
- log(DEFAULT,"Exiting due to a module loader error.");
- printf("\nThere was an error loading a module: %s\n\nYou might want to do './inspircd start' instead of 'bin/inspircd'\n\n",ModuleError());
- Exit(0);
- }
- }
- log(DEFAULT,"Total loaded modules: %lu",(unsigned long)MODCOUNT+1);
-
startup_time = time(NULL);
char PID[MAXBUF];
@@ -2611,9 +2595,6 @@ int InspIRCd(char** argv, int argc)
printf("\nERROR: Was not able to bind any of %lu ports! Please check your configuration.\n\n", (unsigned long)portCount);
return (ERROR);
}
-
-
- printf("\nInspIRCd is now running!\n");
if (nofork)
{
@@ -2631,6 +2612,29 @@ int InspIRCd(char** argv, int argc)
SE = new SocketEngine();
+ /* We must load the modules AFTER initializing the socket engine, now */
+ MODCOUNT = -1;
+ for (count = 0; count < ConfValueEnum("module",&config_f); count++)
+ {
+ ConfValue("module","name",count,configToken,&config_f);
+ printf("Loading module... \033[1;32m%s\033[0m\n",configToken);
+ if (!LoadModule(configToken))
+ {
+ log(DEFAULT,"Exiting due to a module loader error.");
+ printf("\nThere was an error loading a module: %s\n\nYou might want to do './inspircd start' instead of 'bin/inspircd'\n\n",ModuleError());
+ Exit(0);
+ }
+ }
+ log(DEFAULT,"Total loaded modules: %lu",(unsigned long)MODCOUNT+1);
+
+ printf("\nInspIRCd is now running!\n");
+
+ if (!nofork)
+ {
+ freopen("/dev/null","w",stdout);
+ freopen("/dev/null","w",stderr);
+ }
+
/* Add the listening sockets used for client inbound connections
* to the socket engine
*/