summaryrefslogtreecommitdiff
path: root/source3/tdb/tdb.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-05-06 01:28:17 +0000
committerAndrew Tridgell <tridge@samba.org>2001-05-06 01:28:17 +0000
commit906a512e0b6b6b4d3398db274c7e34ce788357df (patch)
treee09b72d44d3a16fcd771001b42fdd9b6314d3e53 /source3/tdb/tdb.c
parent887d796a28a0aa28db84f1c02a1873f7f9f0cb0d (diff)
downloadsamba-906a512e0b6b6b4d3398db274c7e34ce788357df.tar.gz
samba-906a512e0b6b6b4d3398db274c7e34ce788357df.tar.bz2
samba-906a512e0b6b6b4d3398db274c7e34ce788357df.zip
merge from 2.2
(This used to be commit 13bf966cb8ed8df6b02018dceff94c275def8200)
Diffstat (limited to 'source3/tdb/tdb.c')
-rw-r--r--source3/tdb/tdb.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index bf94e4cbd3..e4f6325dc4 100644
--- a/source3/tdb/tdb.c
+++ b/source3/tdb/tdb.c
@@ -429,7 +429,6 @@ static int tdb_expand(TDB_CONTEXT *tdb, tdb_off size)
struct list_struct rec;
tdb_off offset;
char b = 0;
- void *old_map_ptr;
if (tdb_lock(tdb, -1, F_WRLCK) == -1) return 0;
@@ -440,8 +439,6 @@ static int tdb_expand(TDB_CONTEXT *tdb, tdb_off size)
the database up to a multiple of TDB_PAGE_SIZE */
size = TDB_ALIGN(tdb->map_size + size*10, TDB_PAGE_SIZE) - tdb->map_size;
- old_map_ptr = tdb->map_ptr;
-
if (!(tdb->flags & TDB_INTERNAL) && tdb->map_ptr)
tdb->map_ptr = tdb_munmap(tdb->map_ptr, tdb->map_size);
@@ -472,9 +469,8 @@ static int tdb_expand(TDB_CONTEXT *tdb, tdb_off size)
if (!(tdb->flags & TDB_NOMMAP)) {
tdb->map_ptr = tdb_mmap(tdb->map_size, 0, tdb->fd);
- /* if old_map_ptr was != NULL but the new one is, we have an error. */
- if (old_map_ptr && (tdb->map_ptr == NULL))
- goto fail;
+ /* We're ok if this fails and returns NULL, as we'll
+ fallback to read/write here. */
}
/* form a new freelist record */