fix file lock on SunOS
This commit is contained in:
parent
00b6f53a55
commit
7adb641d7c
@ -75,12 +75,12 @@ class LockHandler
|
|||||||
$error = $msg;
|
$error = $msg;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!$this->handle = fopen($this->file, 'r')) {
|
if (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) {
|
||||||
if ($this->handle = fopen($this->file, 'x')) {
|
if ($this->handle = fopen($this->file, 'x')) {
|
||||||
chmod($this->file, 0444);
|
chmod($this->file, 0444);
|
||||||
} elseif (!$this->handle = fopen($this->file, 'r')) {
|
} elseif (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) {
|
||||||
usleep(100); // Give some time for chmod() to complete
|
usleep(100); // Give some time for chmod() to complete
|
||||||
$this->handle = fopen($this->file, 'r');
|
$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
|
Reference in New Issue
Block a user