From a2d036bdc0539b1b0954a2332e9f6b0fe09624c1 Mon Sep 17 00:00:00 2001 From: "preed%mozilla.com" Date: Thu, 8 Mar 2007 20:40:52 +0000 Subject: [PATCH] Bug 372583: Make sure we don't clobber any other filehandles called "LOGFILE", make sure the sigNum we return really is the signal number, Handle dumped core appropriately (stolen from the patch for bug 372582). r=rhelmer --- tools/release/MozBuild/Util.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/release/MozBuild/Util.pm b/tools/release/MozBuild/Util.pm index a0cac5083dce..c20ea6307e41 100644 --- a/tools/release/MozBuild/Util.pm +++ b/tools/release/MozBuild/Util.pm @@ -101,6 +101,7 @@ sub RunShellCommand { my $output = ''; my $childPid = 0; my $childStartedTime = 0; + local *LOGFILE; if (defined($changeToDir)) { chdir($changeToDir) or die("RunShellCommand(): failed to chdir() to " @@ -133,7 +134,7 @@ sub RunShellCommand { endTime => undef, timedOut => $timedOut, exitValue => $exitValue, - sigName => $signalNum, + sigNum => $signalNum, output => undef, dumpedCore => $dumpedCore, pid => $childPid, @@ -193,7 +194,7 @@ sub RunShellCommand { $childEndedTime = localtime(); $exitValue = WEXITSTATUS($?); $signalNum = WIFSIGNALED($?) && WTERMSIG($?); - $dumpedCore = WIFSIGNALED($?) && WCOREDUMP($?); + $dumpedCore = WIFSIGNALED($?) && ($? & 128); $childReaped = 1; } } @@ -225,7 +226,7 @@ sub RunShellCommand { endTime => $childEndedTime, timedOut => $timedOut, exitValue => $exitValue, - sigName => $sigName, + sigNum => $signalNum, output => $output, dumpedCore => $dumpedCore };