#
# This program is free but copyrighted software; see
# the file COPYING for details.
#
# ---------------------------------------------------
#
#
# This program is free but copyrighted software; see
# the file COPYING for details.
#
# ---------------------------------------------------
#
# Lets see what they want to do.. Set the variable (Cause i'm a lazy coder)
my $arg = shift(@ARGV);
my $conf = $confpath . "inspircd.conf";
# Lets see what they want to do.. Set the variable (Cause i'm a lazy coder)
my $arg = shift(@ARGV);
my $conf = $confpath . "inspircd.conf";
my @cmds = grep /^cmd_/, @subs;
my @devs = grep /^dev_/, @subs;
local $_;
my @cmds = grep /^cmd_/, @subs;
my @devs = grep /^dev_/, @subs;
local $_;
- exec {gdb} 'gdb', "--command=$basepath/.gdbargs", "--args $binpath/$executable", qw(-nofork -debug), @_;
+ exec 'gdb', "--command=$basepath/.gdbargs", '--args', "$binpath/$executable", qw(-nofork -debug), @_;
# If we are still alive here.. Try starting the IRCd..
print "Starting InspIRCd in `screen`, type `screen -r` when the ircd crashes to view the gdb output and get a backtrace.\n";
print "Once you're inside the screen session press ^C + d to re-detach from the session\n";
# If we are still alive here.. Try starting the IRCd..
print "Starting InspIRCd in `screen`, type `screen -r` when the ircd crashes to view the gdb output and get a backtrace.\n";
print "Once you're inside the screen session press ^C + d to re-detach from the session\n";
- exec {screen} qw(screen -m -d gdb), "--comand=$basepath/.gdbargs", '-args', "$binpath/$executable", qw(-nofork -debug -nolog), @_;
+ exec qw(screen -m -d gdb), "--comand=$basepath/.gdbargs", '-args', "$binpath/$executable", qw(-nofork -debug -nolog), @_;
# If we are still alive here.. Try starting the IRCd..
# May want to do something with these args at some point: --suppressions=.inspircd.sup --gen-suppressions=yes
# Could be useful when we want to stop it complaining about things we're sure aren't issues.
# If we are still alive here.. Try starting the IRCd..
# May want to do something with these args at some point: --suppressions=.inspircd.sup --gen-suppressions=yes
# Could be useful when we want to stop it complaining about things we're sure aren't issues.
- exec {valgrind} qw(valgrind -v --tool=memcheck --leak-check=yes --db-attach=yes --num-callers=10), "$binpath/$executable", qw(-nofork -debug -nolog), @_;
+ exec qw(valgrind -v --tool=memcheck --leak-check=yes --db-attach=yes --num-callers=10), "$binpath/$executable", qw(-nofork -debug -nolog), @_;
-d $valgrindlogpath or mkdir $valgrindlogpath or die "Cannot create $valgrindlogpath: $!\n";
my $suffix = strftime("%Y%m%d-%H%M%S", localtime(time)) . ".$$";
open STDIN, '<', '/dev/null' or die "Can't redirect STDIN to /dev/null: $!\n";
sysopen STDOUT, "$valgrindlogpath/out.$suffix", O_WRONLY | O_CREAT | O_NOCTTY | O_APPEND, 0600 or die "Can't open $valgrindlogpath/out.$suffix: $!\n";
sysopen STDERR, "$valgrindlogpath/valdebug.$suffix", O_WRONLY | O_CREAT | O_NOCTTY | O_APPEND, 0666 or die "Can't open $valgrindlogpath/valdebug.$suffix: $!\n";
-d $valgrindlogpath or mkdir $valgrindlogpath or die "Cannot create $valgrindlogpath: $!\n";
my $suffix = strftime("%Y%m%d-%H%M%S", localtime(time)) . ".$$";
open STDIN, '<', '/dev/null' or die "Can't redirect STDIN to /dev/null: $!\n";
sysopen STDOUT, "$valgrindlogpath/out.$suffix", O_WRONLY | O_CREAT | O_NOCTTY | O_APPEND, 0600 or die "Can't open $valgrindlogpath/out.$suffix: $!\n";
sysopen STDERR, "$valgrindlogpath/valdebug.$suffix", O_WRONLY | O_CREAT | O_NOCTTY | O_APPEND, 0666 or die "Can't open $valgrindlogpath/valdebug.$suffix: $!\n";
- exec {valgrind} qw(valgrind -v --tool=memcheck --leak-check=yes --num-callers=10 --time-stamp=yes --log-fd=2), "$binpath/$executable", qw(-nofork -debug -nolog), @_;
+ exec qw(valgrind -v --tool=memcheck --leak-check=yes --num-callers=10 --time-stamp=yes --log-fd=2), "$binpath/$executable", qw(-nofork -debug -nolog), @_;
# If we are still alive here.. Try starting the IRCd..
print "Starting InspIRCd in `screen`, type `screen -r` when the ircd crashes to view the valgrind and gdb output and get a backtrace.\n";
print "Once you're inside the screen session press ^C + d to re-detach from the session\n";
# If we are still alive here.. Try starting the IRCd..
print "Starting InspIRCd in `screen`, type `screen -r` when the ircd crashes to view the valgrind and gdb output and get a backtrace.\n";
print "Once you're inside the screen session press ^C + d to re-detach from the session\n";
- exec {screen} qw(screen -m -d valgrind -v --tool=memcheck --leak-check=yes --db-attach=yes --num-callers=10), "$binpath/$executable", qw(-nofork -debug -nolog), @_;
+ exec qw(screen -m -d valgrind -v --tool=memcheck --leak-check=yes --db-attach=yes --num-callers=10), "$binpath/$executable", qw(-nofork -debug -nolog), @_;
- for (my $i = 0; $i < $filesparsed; $i++) {
- if ($filesparsed[$i] eq $file) {
- # Already Parsed, Possible recursive loop..
- return;
- }
- }
-
- # If we get here, Mark as 'Read'
- $filesparsed[$filesparsed] = $file;
+ return if $filesparsed{$file};
+ $filesparsed{$file} = 1;
- for (my $i = 0; $i < $filechecked; $i++) {
- if ($filechecked[$i] eq $file) {
- # Already Parsed, Possible recursive loop..
- return;
- }
- }
-
- # If we get here, Mark as 'Read'
- $filechecked[$filechecked] = $file;
+ return if $filechecked{$file};
+ $filechecked{$file} = 1;
# push @newlines, "<!DOCTYPE config SYSTEM \"".$confpath."inspircd.dtd\">";
push @newlines, "<config>";
# push @newlines, "<!DOCTYPE config SYSTEM \"".$confpath."inspircd.dtd\">";
push @newlines, "<config>";
$tmpfile = tmpnam();
} until sysopen(TF, $tmpfile, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW, 0700);
$tmpfile = tmpnam();
} until sysopen(TF, $tmpfile, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW, 0700);