diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-10-26 13:33:22 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-10-26 13:33:22 +0000 |
commit | 53710af359152719cece85ad883749bba8e47fb5 (patch) | |
tree | f683d563603a69845681644cb6654bc10b4c4169 /perl-install | |
parent | 26760e03e54d72b0d052b2be3b18fb677387055c (diff) | |
download | drakx-backup-do-not-use-53710af359152719cece85ad883749bba8e47fb5.tar drakx-backup-do-not-use-53710af359152719cece85ad883749bba8e47fb5.tar.gz drakx-backup-do-not-use-53710af359152719cece85ad883749bba8e47fb5.tar.bz2 drakx-backup-do-not-use-53710af359152719cece85ad883749bba8e47fb5.tar.xz drakx-backup-do-not-use-53710af359152719cece85ad883749bba8e47fb5.zip |
do not use die when forked, use log::l + c::_exit instead
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/run_program.pm | 15 |
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: $!"); } } |