]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Now with added ANGRY MONKEYS.
[user/henk/code/inspircd.git] / src / inspircd.cpp
index 3ce2261c54034dde2c5282bdcc9ab42dab575ac3..c31dbae5078612afc01989652be99dea1d6afb73 100644 (file)
@@ -586,17 +586,17 @@ 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);
+                       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;
+                       }
+                       if ((int)factory[MODCOUNT+1]->factory != -1)
                        {
                                Module* m = factory[MODCOUNT+1]->factory->CreateModule(MyServer);
                                modules[MODCOUNT+1] = m;
@@ -616,7 +616,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;
                        }
                }
@@ -917,7 +917,13 @@ int InspIRCd::Run()
        this->BuildISupport();
 
        printf("\nInspIRCd is now running!\n");
-       
+
+       if (!stats->BoundPortCount)
+       {
+               printf("\nI couldn't bind any ports! Are you sure you didn't start InspIRCd twice?\n");
+               Exit(ERROR);
+       }
+
        if (!Config->nofork)
        {
                fclose(stdout);
@@ -928,8 +934,12 @@ int InspIRCd::Run()
        /* Add the listening sockets used for client inbound connections
         * to the socket engine
         */
+       log(DEBUG,"%d listeners",stats->BoundPortCount);
        for (unsigned long count = 0; count < stats->BoundPortCount; count++)
+       {
+               log(DEBUG,"Add listener: %d",Config->openSockfd[count]);
                SE->AddFd(Config->openSockfd[count],true,X_LISTEN);
+       }
 
        this->WritePID(Config->PID);