summaryrefslogtreecommitdiffstats
path: root/perl-install/run_program.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-10-26 13:32:27 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-10-26 13:32:27 +0000
commitf07e59d607308fcd9e855f406eb59e371cb6f340 (patch)
treeddb794c5840f3361ef3cc5df984259dc1dac0299 /perl-install/run_program.pm
parent787e6ce460119ee74b70a408da172dfec9db6539 (diff)
downloaddrakx-f07e59d607308fcd9e855f406eb59e371cb6f340.tar
drakx-f07e59d607308fcd9e855f406eb59e371cb6f340.tar.gz
drakx-f07e59d607308fcd9e855f406eb59e371cb6f340.tar.bz2
drakx-f07e59d607308fcd9e855f406eb59e371cb6f340.tar.xz
drakx-f07e59d607308fcd9e855f406eb59e371cb6f340.zip
do not use die when forked, use log::l + c::_exit instead
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r--perl-install/run_program.pm15
1 files changed, 9 insertions, 6 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm
index a560d8c34..c62abcb07 100644
--- a/perl-install/run_program.pm
+++ b/perl-install/run_program.pm
@@ -103,18 +103,22 @@ sub raw {
$ok;
}
} else {
+ sub die_exit {
+ log::l($_[0]);
+ c::_exit(128);
+ }
if ($stderr && $stderr eq 'STDERR') {
} elsif ($stderr) {
$stderr_mode =~ s/2//;
- open STDERR, "$stderr_mode $stderr" or die "run_program can't output in $stderr (mode `$stderr_mode')";
+ open STDERR, "$stderr_mode $stderr" or die_exit("run_program can't output in $stderr (mode `$stderr_mode')");
} elsif ($::isInstall) {
- open STDERR, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or die "run_program can't log, give me access to /tmp/ddebug.log";
+ open STDERR, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or die_exit("run_program can't log, give me access to /tmp/ddebug.log");
}
if ($stdout && $stdout eq 'STDOUT') {
} elsif ($stdout) {
- open STDOUT, "$stdout_mode $stdout" or die "run_program can't output in $stdout (mode `$stdout_mode')";
+ open STDOUT, "$stdout_mode $stdout" or die_exit("run_program can't output in $stdout (mode `$stdout_mode')");
} elsif ($::isInstall) {
- open STDOUT, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or die "run_program can't log, give me access to /tmp/ddebug.log";
+ open STDOUT, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or die_exit("run_program can't log, give me access to /tmp/ddebug.log");
}
$root and chroot $root;
@@ -126,8 +130,7 @@ sub raw {
exec $name, @args;
};
if (!$ok) {
- log::l("exec of $real_name failed: $!");
- c::_exit(128);
+ die_exit("exec of $real_name failed: $!");
}
}