Don't use CLEAR_IF_FIRST if opening read-only.
authorJeremy Allison <jra@samba.org>
Sun, 26 Aug 2001 19:27:18 +0000 (19:27 +0000)
committerJeremy Allison <jra@samba.org>
Sun, 26 Aug 2001 19:27:18 +0000 (19:27 +0000)
Jeremy.
(This used to be commit f5ba19c12989dd1e996473869468afcfc5dce72e)

source3/locking/brlock.c

index a642be317c1173682c827674f52b5ff2e6eb9059..dc2f39e7d9b3f931ab00ca08f4c6fb7289e98a24 100644 (file)
@@ -201,7 +201,7 @@ void brl_init(int read_only)
 
        if (tdb)
                return;
-       tdb = tdb_open_log(lock_path("brlock.tdb"), 0, TDB_CLEAR_IF_FIRST|USE_TDB_MMAP_FLAG, 
+       tdb = tdb_open_log(lock_path("brlock.tdb"), 0,  USE_TDB_MMAP_FLAG|(read_only?0x0:TDB_CLEAR_IF_FIRST),
                       read_only?O_RDONLY:(O_RDWR|O_CREAT), 0644);
        if (!tdb) {
                DEBUG(0,("Failed to open byte range locking database\n"));