From 53710af359152719cece85ad883749bba8e47fb5 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 26 Oct 2004 13:33:22 +0000 Subject: do not use die when forked, use log::l + c::_exit instead --- perl-install/run_program.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'perl-install') 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: $!"); } } -- cgit v1.2.1