diff options
author | Andreas Gohr <andi@splitbrain.org> | 2006-05-17 18:50:23 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2006-05-17 18:50:23 +0200 |
commit | 77b9890307337d49a0f519746f6a6f4ee1d61334 (patch) | |
tree | 1b3830e44cd656fb68b1b50bd3c6ff5f7822446e /inc/io.php | |
parent | d712b399114f02d43330c1e1e8c489729e59210b (diff) | |
download | rpg-77b9890307337d49a0f519746f6a6f4ee1d61334.tar.gz rpg-77b9890307337d49a0f519746f6a6f4ee1d61334.tar.bz2 |
avoid trolling in io_lock()
darcs-hash:20060517165023-7ad00-f3583cd929bf80721593f8fc77fb74bd6b864b03.gz
Diffstat (limited to 'inc/io.php')
-rw-r--r-- | inc/io.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/inc/io.php b/inc/io.php index a44e498a2..ea20502bb 100644 --- a/inc/io.php +++ b/inc/io.php @@ -181,7 +181,11 @@ function io_lock($file){ //waited longer than 3 seconds? -> stale lock if ((time() - $timeStart) > 3) break; $locked = @mkdir($lockDir, $conf['dmode']); - if($locked && $conf['dperm']) chmod($lockDir, $conf['dperm']); + if($locked){ + if($conf['dperm']) chmod($lockDir, $conf['dperm']); + break; + } + usleep(50); } while ($locked === false); } |