diff options
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r-- | perl-install/run_program.pm | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index 5bfd0352a..c237d7214 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -120,17 +120,14 @@ sub raw { $root and chroot $root; chdir "/"; - if (ref $name) { - unless (exec { $name->[0] } $name->[1], @args) { - log::l("exec of $name->[0] failed: $!"); - c::_exit(128); - } - } else { - unless (exec $name, @args) { - log::l("exec of $name failed: $!"); - c::_exit(128); - } - + my $ok = ref $name ? do { + exec { $name->[0] } $name->[1], @args; + } : do { + exec $name, @args; + }; + if (!$ok) { + log::l("exec of $str failed: $!"); + c::_exit(128); } } |