Add function_exists for posix_getsid
Used to support operating systems that don't support posix_getsid
This commit is contained in:
@@ -49,12 +49,20 @@
|
|||||||
//check to see if the process is running
|
//check to see if the process is running
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
$pid = file_get_contents($file);
|
$pid = file_get_contents($file);
|
||||||
if (posix_getsid($pid) === false) {
|
if (function_exists('posix_getsid')) {
|
||||||
//process is not running
|
//check if the process is running
|
||||||
$exists = false;
|
$pid = posix_getsid($pid);
|
||||||
|
if ($pid === null || $pid === 0) {
|
||||||
|
//process is not running
|
||||||
|
$exists = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//process is running
|
||||||
|
$exists = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//process is running
|
//file exists assume the pid is running
|
||||||
$exists = true;
|
$exists = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -571,4 +579,3 @@
|
|||||||
|
|
||||||
//fwrite($esl, $content);
|
//fwrite($esl, $content);
|
||||||
//fclose($esl);
|
//fclose($esl);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user