From 6087d621f732289966d52e253477e3faa8e3f1bb Mon Sep 17 00:00:00 2001 From: peavey Date: Fri, 9 May 2008 01:13:02 +0000 Subject: 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 --- src/inspircd.cpp | 8 +++++--- 1 file 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)); -- cgit v1.2.3