]> granicus.if.org Git - php/commitdiff
fix locks and reading
authorMarcus Boerger <helly@php.net>
Wed, 6 Nov 2002 10:43:41 +0000 (10:43 +0000)
committerMarcus Boerger <helly@php.net>
Wed, 6 Nov 2002 10:43:41 +0000 (10:43 +0000)
#i will extend the tests to guard on such failures

ext/dba/dba_flatfile.c

index 4976f32e56704430203e1d480b6a3739121b27d2..d64a7feec1a33a595e3c5d699ff819d6b602f57f 100644 (file)
@@ -157,16 +157,16 @@ DBA_CLOSE_FUNC(flatfile)
 {
        DBM_DATA;
 
+       if (dba->lockfn) {
 #if NFS_HACK
-       VCWD_UNLINK(dba->lockfn);
+               VCWD_UNLINK(dba->lockfn);
 #else
-       if (dba->lockfn) {
                /*dba->lockfd = VCWD_OPEN_MODE(dba->lockfn, O_RDWR, 0644);*/
                flock(dba->lockfd, LOCK_UN);
                close(dba->lockfd);
-       }
 #endif
-       efree(dba->lockfn);
+               efree(dba->lockfn);
+       }
 
        php_stream_close(dba->fp);
        if (dba->nextkey.dptr)