1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-28 20:40:24 +02:00

[ticket/16325] Ensure lock file is opened for updating

PHPBB3-16325
This commit is contained in:
Marc Alexander
2020-02-28 07:54:48 +01:00
parent b1f0276307
commit e263405a81

View File

@@ -73,7 +73,7 @@ class flock
// one file for writing simultaneously // one file for writing simultaneously
if (file_exists($this->path . '.lock')) if (file_exists($this->path . '.lock'))
{ {
$mode = 'rb'; $mode = 'rb+';
} }
else else
{ {
@@ -89,7 +89,7 @@ class flock
// Two processes may attempt to create lock file at the same time. // Two processes may attempt to create lock file at the same time.
// Have the losing process try opening the lock file again for reading // Have the losing process try opening the lock file again for reading
// on the assumption that the winning process created it // on the assumption that the winning process created it
$mode = 'rb'; $mode = 'rb+';
$this->lock_fp = @fopen($this->path . '.lock', $mode); $this->lock_fp = @fopen($this->path . '.lock', $mode);
} }
else else