diff options
Diffstat (limited to 'pear/PEAR/Registry.php')
-rw-r--r-- | pear/PEAR/Registry.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pear/PEAR/Registry.php b/pear/PEAR/Registry.php index f85bbfdd56..631328bea9 100644 --- a/pear/PEAR/Registry.php +++ b/pear/PEAR/Registry.php @@ -286,7 +286,9 @@ class PEAR_Registry extends PEAR $open_mode = 'r'; } - $this->lock_fp = @fopen($this->lockfile, $open_mode); + if (!is_resource($this->lock_fp)) { + $this->lock_fp = @fopen($this->lockfile, $open_mode); + } if (!is_resource($this->lock_fp)) { return $this->raiseError("could not create lock file" . @@ -312,6 +314,9 @@ class PEAR_Registry extends PEAR function _unlock() { $ret = $this->_lock(LOCK_UN); + if (is_resource($this->lock_fp)) { + fclose($this->lock_fp); + } $this->lock_fp = null; return $ret; } |