cvs: php4 /pear/PEAR Registry.php
| From: | Tomas V.V.Cox | Date: | Mon, 01 Apr 2002 16:10:39 +0000 |
| Subject: | cvs: php4 /pear/PEAR Registry.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2942@lists.php.net to get a copy of this message | ||
cox Mon Apr 1 11:10:39 2002 EDT
Modified files:
/php4/pear/PEAR Registry.php
Log:
People reported problems with flock(LOCK_SH) and fopen('w')
Index: php4/pear/PEAR/Registry.php
diff -u php4/pear/PEAR/Registry.php:1.21 php4/pear/PEAR/Registry.php:1.22
--- php4/pear/PEAR/Registry.php:1.21 Tue Mar 26 11:29:53 2002
+++ php4/pear/PEAR/Registry.php Mon Apr 1 11:10:39 2002
@@ -16,7 +16,7 @@
// | Author: Stig Bakken <ssb@fast.no> |
// +----------------------------------------------------------------------+
//
-// $Id: Registry.php,v 1.21 2002/03/26 16:29:53 cox Exp $
+// $Id: Registry.php,v 1.22 2002/04/01 16:10:39 cox Exp $
require_once "System.php";
require_once "PEAR.php";
@@ -215,7 +215,9 @@
if (PEAR::isError($err = $this->_assertStateDir())) {
return $err;
}
- $this->lock_fp = @fopen($this->lockfile, 'w');
+ // XXX People reported problems with LOCK_SH and 'w'
+ $open_mode = ($mode === LOCK_SH) ? 'r' : 'w';
+ $this->lock_fp = @fopen($this->lockfile, $open_mode);
if (!is_resource($this->lock_fp)) {
return $this->raiseError("could not create lock file: $php_errormsg");
}