summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-09 01:13:02 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-09 01:13:02 +0000
commit6087d621f732289966d52e253477e3faa8e3f1bb (patch)
tree457df6898b6a5b00daba67930d622b68dd738eee /src
parent99a1ea0892b575c6d66d9f4c0aab5042c261ce4a (diff)
Fix restart code, by getting run path and argv before calling Cleanup()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9674 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index d09dff840..d152e5d1a 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));