]> granicus.if.org Git - php/commitdiff
-Precondiftion: no open files
authorMarcus Boerger <helly@php.net>
Mon, 11 Nov 2002 12:00:58 +0000 (12:00 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 11 Nov 2002 12:00:58 +0000 (12:00 +0000)
-do not show warning from dba_open call for read during write
# Interesting is that on some systems read during write is permitted...
# I will change the tests as soon as i find a way to have this equal on all
# systems

ext/dba/tests/dba_handler.inc
ext/dba/tests/test.inc

index 98048bb7c08eb405e350687e5a8415523bed5f19..5690075fab6b4da4282c6661820817151ced4fc3 100644 (file)
@@ -1,6 +1,5 @@
 <?php
        echo "database handler: $handler\n";
-       @unlink($db_filename);
        if (($db_file = dba_open($db_filename, 'n'.$lock_flag, $handler))!==FALSE) {
                dba_insert("key1", "Content String 1", $db_file);
                dba_insert("key2", "Content String 2", $db_file);
@@ -28,7 +27,7 @@
                echo "Error creating database\n";
        }
        $db_writer = dba_open($db_filename, 'w'.$lock_flag, $handler);
-       if (($dba_reader = dba_open($db_filename, 'r'.$lock_flag.($lock_flag ? 't' : ''), $handler))===false) {
+       if (($dba_reader = @dba_open($db_filename, 'r'.$lock_flag.($lock_flag ? 't' : ''), $handler))===false) {
                echo "Cannot read during write operation\n";
        } else {
                echo "Read during write permitted\n";
index bd617bc8d63619b5c978e6e65f5ff1e37b1d6ac0..e280226f683c161ef686adcf4c32c232b231deca 100644 (file)
@@ -11,4 +11,6 @@
                $handler = $handler[0];
        }
        $lock_flag = 'l';
+       @unlink($db_filename);
+       @unlink($db_filename.'.lck');
 ?>