From 8757ad45a814d2ef28860bc72796cf249e4a70bb Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Sat, 27 Apr 2013 20:16:01 +0200 Subject: [PATCH] [Process] Fix #5594 : `termsig` must be used instead of `stopsig` in exceptions when a process is signaled --- src/Symfony/Component/Process/Process.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index c4546b41e9..dcef32a02f 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -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'];