cvs: php4 /ext/dba dba.c
| From: | Marcus Boerger | Date: | Wed, 11 Dec 2002 10:37:39 +0000 |
| Subject: | cvs: php4 /ext/dba dba.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-17108@lists.php.net to get a copy of this message | ||
helly Wed Dec 11 05:37:39 2002 EDT
Modified files:
/php4/ext/dba dba.c
Log:
Warnings and Notices when lock modifiers for dba_(p)open are used wrong.
This finally closes bug #20828 (and i hope it must not be reopened)
Index: php4/ext/dba/dba.c
diff -u php4/ext/dba/dba.c:1.70 php4/ext/dba/dba.c:1.71
--- php4/ext/dba/dba.c:1.70 Tue Dec 10 17:51:09 2002
+++ php4/ext/dba/dba.c Wed Dec 11 05:37:38 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba.c,v 1.70 2002/12/10 22:51:09 helly Exp $ */
+/* $Id: dba.c,v 1.71 2002/12/11 10:37:38 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -430,16 +430,21 @@
if (pmode[0] && (pmode[1]=='d' || pmode[1]=='l' ||
pmode[1]=='-')) { /* force lock on db file or lck file or disable locking */
switch (pmode[1]) {
case 'd':
- if ((hptr->flags & DBA_LOCK_ALL) == 0) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_NOTICE,
"Handler %s does locking internally", hptr->name);
- }
lock_dbf = 1;
/* no break */
case 'l':
lock_flag = DBA_LOCK_ALL;
+ if ((hptr->flags & DBA_LOCK_ALL) == 0) {
+ php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_NOTICE,
"Handler %s does locking internally", hptr->name);
+ }
break;
default:
case '-':
+ if ((hptr->flags & DBA_LOCK_ALL) == 0) {
+ php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING,
"Locking cannot be disabled for handler %s", hptr->name);
+ FREENOW;
+ RETURN_FALSE;
+ }
lock_flag = 0;
break;
}