Add function_exists for posix_getsid
Used to support operating systems that don't support posix_getsid
This commit is contained in:
parent
78306a1a68
commit
f0837e173b
|
|
@ -49,7 +49,10 @@
|
|||
//check to see if the process is running
|
||||
if (file_exists($file)) {
|
||||
$pid = file_get_contents($file);
|
||||
if (posix_getsid($pid) === 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;
|
||||
}
|
||||
|
|
@ -58,6 +61,11 @@
|
|||
$exists = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//file exists assume the pid is running
|
||||
$exists = true;
|
||||
}
|
||||
}
|
||||
|
||||
//return the result
|
||||
return $exists;
|
||||
|
|
@ -571,4 +579,3 @@
|
|||
|
||||
//fwrite($esl, $content);
|
||||
//fclose($esl);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue