]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Collision tweaks
[user/henk/code/inspircd.git] / src / inspircd.cpp
index d09dff84067f35612d4942559e42a5288b5628ac..ab499f1d1a66a1d13d385563b3c481ad9cb945f8 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));
@@ -349,7 +351,8 @@ bool InspIRCd::DaemonSeed()
 void InspIRCd::WritePID(const std::string &filename)
 {
        std::string fname = (filename.empty() ? "inspircd.pid" : filename);
-       if (*(fname.begin()) != '/')
+       std::replace(fname.begin(), fname.end(), '\\', '/');
+       if ((fname[0] != '/') && (!Config->StartsWithWindowsDriveLetter(filename)))
        {
                std::string::size_type pos;
                std::string confpath = this->ConfigFileName;
@@ -677,7 +680,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
        {
                printf("\nWARNING: Not all your client ports could be bound --\nstarting anyway with %d of %d client ports bound.\n\n", bounditems, found_ports);
                printf("The following port(s) failed to bind:\n");
-               printf("Hint: Try using an IP instead of blank or *\n\n");
+               printf("Hint: Try using a public IP instead of blank or *\n\n");
                int j = 1;
                for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++)
                {
@@ -703,7 +706,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);