X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd.cpp;h=ab499f1d1a66a1d13d385563b3c481ad9cb945f8;hb=24d34de00efac5ff04c53a09cab995654bf6f5b7;hp=d09dff84067f35612d4942559e42a5288b5628ac;hpb=98659aa0dcac7636627846555ef7d5f807152b7e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd.cpp b/src/inspircd.cpp index d09dff840..ab499f1d1 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -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);