make_lockfile: only call posix_getpid() if it actually exists (hello, win32)

This commit is contained in:
Andrew Dolgov 2010-02-09 17:05:02 +03:00
parent 82acc36dba
commit 4c59adb1de
1 changed files with 3 additions and 1 deletions

View File

@ -2236,7 +2236,9 @@
$fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
if (flock($fp, LOCK_EX | LOCK_NB)) {
if (function_exists('posix_getpid')) {
fwrite($fp, posix_getpid() . "\n");
}
return $fp;
} else {
return false;