From f0837e173b9101cc0a82c0dd14bb7ba415c77835 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 2 Dec 2024 18:34:49 -0700 Subject: [PATCH] Add function_exists for posix_getsid Used to support operating systems that don't support posix_getsid --- app/email_queue/resources/jobs/email_send.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/email_queue/resources/jobs/email_send.php b/app/email_queue/resources/jobs/email_send.php index 963b17abe9..0b116a691c 100755 --- a/app/email_queue/resources/jobs/email_send.php +++ b/app/email_queue/resources/jobs/email_send.php @@ -49,12 +49,20 @@ //check to see if the process is running if (file_exists($file)) { $pid = file_get_contents($file); - if (posix_getsid($pid) === false) { - //process is not running - $exists = false; + if (function_exists('posix_getsid')) { + //check if the process is running + $pid = posix_getsid($pid); + if ($pid === null || $pid === 0) { + //process is not running + $exists = false; + } + else { + //process is running + $exists = true; + } } else { - //process is running + //file exists assume the pid is running $exists = true; } } @@ -571,4 +579,3 @@ //fwrite($esl, $content); //fclose($esl); -