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
This commit is contained in:
preed%mozilla.com 2007-03-08 20:40:52 +00:00
Родитель 89dd51a153
Коммит a2d036bdc0
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -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
};