]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Don't route after nuking the user from orbit, there's no point (minor)
[user/henk/code/inspircd.git] / src / inspircd.cpp
index d09dff84067f35612d4942559e42a5288b5628ac..97e2c77e352d9da2fecc4f477caaf606687b4484 100644 (file)
@@ -224,8 +224,6 @@ void InspIRCd::Restart(const std::string &reason)
         */
        this->SendError(reason);
 
-       this->Cleanup();
-
        /* Figure out our filename (if theyve renamed it, we're boned) */
        std::string me;
 
@@ -237,7 +235,11 @@ void InspIRCd::Restart(const std::string &reason)
        me = Config->MyDir + "/inspircd";
 #endif
 
-       if (execv(me.c_str(), Config->argv) == -1)
+       char** argv = Config->argv;
+
+       this->Cleanup();
+
+       if (execv(me.c_str(), argv) == -1)
        {
                /* Will raise a SIGABRT if not trapped */
                throw CoreException(std::string("Failed to execv()! error: ") + strerror(errno));
@@ -703,7 +705,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
                 * e.g. we are restarting, or being launched by cron. Dont kill parent, and dont
                 * close stdin/stdout
                 */
-               if (!do_nofork)
+               if ((!do_nofork) && (!do_testsuite))
                {
                        fclose(stdin);
                        fclose(stderr);