diff options
author | Marcus Boerger <helly@php.net> | 2002-11-10 23:07:35 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2002-11-10 23:07:35 +0000 |
commit | b8f3b835119ade0cc82c504a2f7dbbefe6174cde (patch) | |
tree | 0db48c039aebc9b51e6304a60bc0f64f03ef273f /ext | |
parent | 4f636c6b3bc6cbe3654dda070227b4bf076e15b3 (diff) | |
download | php-git-b8f3b835119ade0cc82c504a2f7dbbefe6174cde.tar.gz |
Emit a warning when open mode modifier t is used wrong.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/dba/dba.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 889842faef..6384c5c81b 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -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"); |