mirror of
https://github.com/php/php-src.git
synced 2026-04-29 19:23:22 +02:00
Emit a warning when open mode modifier t is used wrong.
This commit is contained in:
+13
-1
@@ -424,7 +424,19 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
}
|
||||
if (*pmode=='t') {
|
||||
pmode++;
|
||||
lock_mode |= LOCK_NB; /* test =: non blocking */
|
||||
if (!lock_mode) {
|
||||
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, "Handler %s uses its own locking which doesn't support mode modifier t (testing)", hptr->name);
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Handler %s doesn't uses locking for this mode which makes modifier t (testing) obsolete", hptr->name);
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
lock_mode |= LOCK_NB; /* test =: non blocking */
|
||||
}
|
||||
}
|
||||
if (*pmode || !modenr) {
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Illegal DBA mode");
|
||||
|
||||
Reference in New Issue
Block a user