mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Double check before throwing an exception. (#4790)
Since we are running two processes, we could leak one if we throw an exception and execution stops.
This commit is contained in:
committed by
Neil Lathwood
parent
87ff439d8f
commit
da0d04a5b6
@@ -197,11 +197,10 @@ class Proc
|
||||
|
||||
if (!$closed) {
|
||||
// try harder
|
||||
$pid = $status['pid'];
|
||||
$killed = posix_kill($pid, 9); //9 is the SIGKILL signal
|
||||
$killed = posix_kill($status['pid'], 9); //9 is the SIGKILL signal
|
||||
proc_close($this->_process);
|
||||
|
||||
if (!$killed) {
|
||||
if (!$killed && $this->isRunning()) {
|
||||
throw new Exception("Terminate failed!");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user