diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-13 00:43:52 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-13 00:43:52 +0000 |
commit | 547e7e9b382255b1699ff897f40fb4ed659c3360 (patch) | |
tree | 3c98932a043d0f03df5fc29bd2b3e821797e93b5 /.inspircd.inc | |
parent | 382cac82df89b4fc45340a94968bb3eaeeb5f19b (diff) |
Remove needless chdir() from inspircd executable
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11865 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to '.inspircd.inc')
-rw-r--r-- | .inspircd.inc | 9 |
1 files changed, 8 insertions, 1 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"); |