mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-16 21:40:46 +01:00
Replace die with croak, and move Net::IRC::Connection::DESTROY redefinition to before any deaths
This commit is contained in:
parent
d31b7594a2
commit
4e53210445
@ -124,15 +124,15 @@ sub execute_module {
|
|||||||
if($pid == 0) { # start child block
|
if($pid == 0) { # start child block
|
||||||
$self->{child} = 1; # set to be killed after returning
|
$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;
|
no warnings;
|
||||||
*Net::IRC::Connection::DESTROY = sub { return; };
|
*Net::IRC::Connection::DESTROY = sub { return; };
|
||||||
use warnings;
|
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) {
|
if(defined $tonick) {
|
||||||
$self->{pbot}->logger->log("($from): $nick!$user\@$host) sent to $tonick\n");
|
$self->{pbot}->logger->log("($from): $nick!$user\@$host) sent to $tonick\n");
|
||||||
$text = `$module_dir/$module $arguments`;
|
$text = `$module_dir/$module $arguments`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user