fix "Can't use an undefined value as an ARRAY reference at ... line 177" when exec fails and program_args is not defined
This commit is contained in:
parent
e2753e5f8b
commit
bcc3e970c0
2 changed files with 6 additions and 3 deletions
1
Changes
1
Changes
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
* create dir for pid_file if it does not exist
|
* create dir for pid_file if it does not exist
|
||||||
|
* fix uninitialized warning in error when exec fails
|
||||||
|
|
||||||
0.001000 2013-02-26 SymKat <symkat@symkat.com>
|
0.001000 2013-02-26 SymKat <symkat@symkat.com>
|
||||||
* fixed a warning on "uninitialized value $called_with in substitution"
|
* fixed a warning on "uninitialized value $called_with in substitution"
|
||||||
|
|
|
@ -247,12 +247,14 @@ sub _launch_program {
|
||||||
$self->trace( "chdir(" . $self->directory . ")" );
|
$self->trace( "chdir(" . $self->directory . ")" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my @args = @{$self->program_args || [ ]};
|
||||||
|
|
||||||
if ( ref $self->program eq 'CODE' ) {
|
if ( ref $self->program eq 'CODE' ) {
|
||||||
$self->program->( $self, @{$self->program_args || []} );
|
$self->program->( $self, @args );
|
||||||
} else {
|
} else {
|
||||||
exec ( $self->program, @{$self->program_args || [ ]} )
|
exec ( $self->program, @args )
|
||||||
or die "Failed to exec " . $self->program . " "
|
or die "Failed to exec " . $self->program . " "
|
||||||
. join( " ", @{$self->program_args} ) . ": $!";
|
. join( " ", @args ) . ": $!";
|
||||||
}
|
}
|
||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue