]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Dunno why this method was static, doesnt need to be...
[user/henk/code/inspircd.git] / src / inspircd.cpp
index d09092e6956a9c9342548214eac610bf0ed4e309..41b524628abc3daa6f5991447c2086fbba81aed5 100644 (file)
@@ -46,7 +46,7 @@ InspIRCd* SI = NULL;
 /* Burlex: Moved from exitcodes.h -- due to duplicate symbols */
 const char* ExitCodes[] =
 {
-       "No error", /* 0 */
+               "No error", /* 0 */
                "DIE command", /* 1 */
                "execv() failed", /* 2 */
                "Internal error", /* 3 */
@@ -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)
@@ -273,7 +277,7 @@ bool InspIRCd::DaemonSeed()
        sh.lpVerb = 0;
        sh.lpDirectory = 0;
        sh.hInstApp = 0;
-       sh.nShow = SW_SHOW;
+       sh.nShow = SW_HIDE;
        sh.lpFile = "inspircd.exe";
        sh.lpParameters = "--service";
        if(!ShellExecuteEx(&sh))