X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Ffilesystem%2FLockHandler.php;fp=vendor%2Fsymfony%2Ffilesystem%2FLockHandler.php;h=8e0eb741213b2e1c03bd62fbf86ea1450e0ad692;hp=a2e7ad5c336a5f22113cb513b73496f1e377ada9;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/vendor/symfony/filesystem/LockHandler.php b/vendor/symfony/filesystem/LockHandler.php index a2e7ad5c3..8e0eb7412 100644 --- a/vendor/symfony/filesystem/LockHandler.php +++ b/vendor/symfony/filesystem/LockHandler.php @@ -81,12 +81,12 @@ class LockHandler $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')) { - chmod($this->file, 0444); - } elseif (!$this->handle = fopen($this->file, 'r')) { + chmod($this->file, 0666); + } elseif (!$this->handle = fopen($this->file, 'r+') ?: fopen($this->file, 'r')) { 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();