X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd.cpp;h=7e81df32b9be8e7b669a781ebdd9275367ad2164;hb=46ff0bed0047c4cd05828c5f46dce63176e5084b;hp=d09092e6956a9c9342548214eac610bf0ed4e309;hpb=badadc427a99e5483402c21bf5b7ae64722930e9;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd.cpp b/src/inspircd.cpp index d09092e69..7e81df32b 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -169,10 +169,14 @@ void InspIRCd::Restart(const std::string &reason) this->Cleanup(); /* Figure out our filename (if theyve renamed it, we're boned) */ + std::string me; + #ifdef WINDOWS - std::string me = Config->MyDir + "inspircd.exe"; + char module[MAX_PATH]; + if (GetModuleFileName(NULL, module, MAX_PATH)) + me = module; #else - std::string me = Config->MyDir + "/inspircd"; + me = Config->MyDir + "/inspircd"; #endif if (execv(me.c_str(), Config->argv) == -1)