summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-13 00:43:52 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-13 00:43:52 +0000
commit547e7e9b382255b1699ff897f40fb4ed659c3360 (patch)
tree3c98932a043d0f03df5fc29bd2b3e821797e93b5
parent382cac82df89b4fc45340a94968bb3eaeeb5f19b (diff)
Remove needless chdir() from inspircd executable
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11865 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--.inspircd.inc9
-rw-r--r--src/configreader.cpp2
-rw-r--r--src/inspircd.cpp9
3 files changed, 9 insertions, 11 deletions
diff --git a/.inspircd.inc b/.inspircd.inc
index 91a06ccfd..518d823a7 100644
--- a/.inspircd.inc
+++ b/.inspircd.inc
@@ -18,6 +18,7 @@ use Fcntl;
my $basepath = "@BASE_DIR@";
my $confpath = "@CONFIG_DIR@/";
my $binpath = "@BINARY_DIR@";
+my $runpath = "@BINARY_DIR@";
my $valgrindlogpath = "$basepath/valgrindlogs";
my $executable = "@EXECUTABLE@";
my $version = "@VERSION@";
@@ -131,10 +132,11 @@ sub cmd_start(@)
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; }
# If we are still alive here.. Try starting the IRCd..
+ chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");
- exec { "$binpath/$executable" } "$binpath/$executable", @_;
+ exec "$binpath/$executable", @_;
die "Failed to start IRCd: $!\n";
}
@@ -143,6 +145,7 @@ sub dev_debug(@)
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; }
+ chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");
@@ -159,6 +162,7 @@ sub dev_screendebug(@)
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; }
+ chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
#Check we have gdb
@@ -177,6 +181,7 @@ sub dev_valdebug(@)
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; }
+ chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");
@@ -197,6 +202,7 @@ sub dev_valdebug_unattended(@)
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; }
+ chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");
@@ -233,6 +239,7 @@ sub dev_screenvaldebug(@)
# Check to see its not 'running' already.
if (getstatus() == 1) { print "InspIRCd is already running.\n"; return 0; }
+ chdir $runpath;
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");
diff --git a/src/configreader.cpp b/src/configreader.cpp
index b8d675ef1..540653567 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -1673,7 +1673,7 @@ bool ServerConfig::DoInclude(const std::string &file, bool allowexeinc)
if ((newfile[0] != '/') && (!StartsWithWindowsDriveLetter(newfile)))
{
- pos = confpath.rfind("/")
+ pos = confpath.rfind("/");
if(pos != std::string::npos)
{
/* Leaves us with just the path */
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 56e43c3ed..a932b95e1 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -401,15 +401,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
this->Config->argv = argv;
this->Config->argc = argc;
- 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();
-
this->TIME = this->OLDTIME = this->startup_time = time(NULL);
srand(this->TIME);