diff options
| author | fukachan <fukachan> | 2003-10-14 06:58:10 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-10-14 06:58:10 +0000 |
| commit | a429c28a210f1ad533e5244265a81ba6cdec246c (patch) | |
| tree | 11e385f11468c3642c418a1caf81ab566939586a /fml/lib/FML/Process/Kernel.pm | |
| parent | 09909d2c3a815dc799e9ca4b523673c55e2414ce (diff) | |
| download | fml8-a429c28a210f1ad533e5244265a81ba6cdec246c.tar.gz fml8-a429c28a210f1ad533e5244265a81ba6cdec246c.tar.bz2 fml8-a429c28a210f1ad533e5244265a81ba6cdec246c.zip | |
if (defined $pcb) { ...}
Diffstat (limited to 'fml/lib/FML/Process/Kernel.pm')
| -rw-r--r-- | fml/lib/FML/Process/Kernel.pm | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm index 194021c1..1e2afe2b 100644 --- a/fml/lib/FML/Process/Kernel.pm +++ b/fml/lib/FML/Process/Kernel.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Kernel.pm,v 1.182 2003/09/19 13:30:34 tmu Exp $ +# $FML: Kernel.pm,v 1.183 2003/09/27 06:55:11 fukachan Exp $ # package FML::Process::Kernel; @@ -2359,35 +2359,38 @@ sub _finalize_stderr_channel my $config = $curproc->config(); my $option = $curproc->command_line_options(); my $pcb = $curproc->pcb(); - my $tmpfile = $pcb->get("stderr", "logfile"); - my $is_logdup = $pcb->get("stderr", "use_log_dup") || 0; - # avoid duplicated calls. - return unless $is_logdup; - - if ($curproc->is_cgi_process() || - $curproc->is_under_mta_process() || - defined $option->{ quiet } || defined $option->{ q } || - $config->yes('use_log_dup') || $option->{ 'log-dup' } ) { - - close(STDERR); - open(STDERR, ">&STDOUT"); - - if (-s $tmpfile) { - use FileHandle; - my $fh = new FileHandle $tmpfile; - if (defined $fh) { - my $buf; - while ($buf = <$fh>) { - chomp $buf; - $curproc->logwarn($buf); + if (defined $pcb) { + my $tmpfile = $pcb->get("stderr", "logfile"); + my $is_logdup = $pcb->get("stderr", "use_log_dup") || 0; + + # avoid duplicated calls. + return unless $is_logdup; + + if ($curproc->is_cgi_process() || + $curproc->is_under_mta_process() || + defined $option->{ quiet } || defined $option->{ q } || + $config->yes('use_log_dup') || $option->{ 'log-dup' } ) { + + close(STDERR); + open(STDERR, ">&STDOUT"); + + if (-s $tmpfile) { + use FileHandle; + my $fh = new FileHandle $tmpfile; + if (defined $fh) { + my $buf; + while ($buf = <$fh>) { + chomp $buf; + $curproc->logwarn($buf); + } + $fh->close(); } - $fh->close(); } } - } - $pcb->set("stderr", "use_log_dup", 0); + $pcb->set("stderr", "use_log_dup", 0); + } } |
