From acce38fa8452fccd1d353b3d78c448a8d33aba87 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 20 May 2007 20:27:45 +0000 Subject: Crash on restart in win32 fixed. This means that the restart button in the gui, and /restart, both work now. Note, there are other bugs with the gui's restart button, the 'auto restart on crash' tries to boot the ircd! Dont use it! :P git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7075 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/inspircd.cpp') 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) -- cgit v1.2.3