From e04794af4a9124c109dc1f3e3cc5eb772229070e Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 26 Jul 2007 19:51:05 +0000 Subject: Abort if we cant chdir to our own dir (i'd say we have bigger things to worry about if this happens, but meh) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7585 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 35036afe9..c8125b078 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -421,7 +421,11 @@ InspIRCd::InspIRCd(int argc, char** argv) this->Config->argv = argv; this->Config->argc = argc; - chdir(Config->GetFullProgDir().c_str()); + if (chdir(Config->GetFullProgDir().c_str())) + { + printf("Unable to change to my directory: %s\nAborted.", strerror(errno)); + exit(0); + } this->Config->opertypes.clear(); this->Config->operclass.clear(); -- cgit v1.2.3