]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_restart.cpp
Swap around ERROR and SNONOTICE in SendError() so that the server doesnt try and...
[user/henk/code/inspircd.git] / src / cmd_restart.cpp
index 73bfce298eb51cc7603b07cc3f26a8ee28a5359e..b9afd7c9db4f315e429ae2180da93b89dc279972 100644 (file)
  * ---------------------------------------------------
  */
 
-#include "configreader.h"
-#include "users.h"
+#include "inspircd.h"
 #include "commands/cmd_restart.h"
 
-
-
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_restart(Instance);
 }
@@ -28,7 +25,16 @@ CmdResult cmd_restart::Handle (const char** parameters, int pcnt, userrec *user)
        if (!strcmp(parameters[0],ServerInstance->Config->restartpass))
        {
                ServerInstance->WriteOpers("*** RESTART command from %s!%s@%s, restarting server.",user->nick,user->ident,user->host);
-               ServerInstance->Restart("Server restarting");
+
+               try
+               {
+                       ServerInstance->Restart("Server restarting.");
+               }
+               catch (...)
+               {
+                       /* We dont actually get here unless theres some fatal and unrecoverable error. */
+                       exit(0);
+               }
        }
        else
        {