summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-20 20:27:45 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-20 20:27:45 +0000
commitacce38fa8452fccd1d353b3d78c448a8d33aba87 (patch)
treea664c7078324ba02debeffe2447d9e267d66848c
parentaf7ccb969170ee752dbc7324c4aa999c57402296 (diff)
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
-rw-r--r--src/inspircd.cpp8
1 files changed, 6 insertions, 2 deletions
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)