3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-01 17:16:39 +02:00

Replace die with croak, and move Net::IRC::Connection::DESTROY redefinition to before any deaths

This commit is contained in:
Pragmatic Software 2010-05-27 09:29:17 +00:00
parent d31b7594a2
commit 4e53210445

View File

@ -124,15 +124,15 @@ sub execute_module {
if($pid == 0) { # start child block
$self->{child} = 1; # set to be killed after returning
if(not chdir $module_dir) {
$self->{pbot}->logger->log("Could not chdir to '$module_dir': $!\n");
die $!;
}
no warnings;
*Net::IRC::Connection::DESTROY = sub { return; };
use warnings;
if(not chdir $module_dir) {
$self->{pbot}->logger->log("Could not chdir to '$module_dir': $!\n");
Carp::croak("Could not chdir to '$module_dir': $!");
}
if(defined $tonick) {
$self->{pbot}->logger->log("($from): $nick!$user\@$host) sent to $tonick\n");
$text = `$module_dir/$module $arguments`;