make_lockfile: save current PID

This commit is contained in:
Andrew Dolgov 2010-02-05 15:01:36 +03:00
parent 44cfa02554
commit 82acc36dba
1 changed files with 2 additions and 1 deletions

View File

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