[Process] Fix #5594 : `termsig` must be used instead of `stopsig` in exceptions when a process is signaled

This commit is contained in:
Romain Neutron 2013-04-27 20:16:01 +02:00
parent 9abcf4f81b
commit 8757ad45a8
1 changed files with 8 additions and 2 deletions

View File

@ -398,7 +398,10 @@ class Process
}
$this->updateStatus();
if ($this->processInformation['signaled']) {
throw new \RuntimeException(sprintf('The process stopped because of a "%s" signal.', $this->processInformation['stopsig']));
if ($this->isSigchildEnabled()) {
throw new RuntimeException('The process has been signaled.');
}
throw new RuntimeException(sprintf('The process has been signaled with signal "%s".', $this->processInformation['termsig']));
}
$time = 0;
@ -410,7 +413,10 @@ class Process
$exitcode = proc_close($this->process);
if ($this->processInformation['signaled']) {
throw new \RuntimeException(sprintf('The process stopped because of a "%s" signal.', $this->processInformation['stopsig']));
if ($this->isSigchildEnabled()) {
throw new RuntimeException('The process has been signaled.');
}
throw new RuntimeException(sprintf('The process has been signaled with signal "%s".', $this->processInformation['termsig']));
}
$this->exitcode = $this->processInformation['running'] ? $exitcode : $this->processInformation['exitcode'];