diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-05-06 01:28:17 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-05-06 01:28:17 +0000 |
commit | 13bf966cb8ed8df6b02018dceff94c275def8200 (patch) | |
tree | 0f7cc07a5f25ef547475ef4cd91fba0e6dc52561 /source/tdb | |
parent | 4c6a8273c6dd3e2aeda5a63c4a62aa55bc133099 (diff) | |
download | samba-13bf966cb8ed8df6b02018dceff94c275def8200.tar.gz samba-13bf966cb8ed8df6b02018dceff94c275def8200.tar.xz samba-13bf966cb8ed8df6b02018dceff94c275def8200.zip |
merge from 2.2
Diffstat (limited to 'source/tdb')
-rw-r--r-- | source/tdb/tdb.c | 8 | ||||
-rw-r--r-- | source/tdb/tdbutil.c | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c index bf94e4cbd3f..e4f6325dc41 100644 --- a/source/tdb/tdb.c +++ b/source/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 */ diff --git a/source/tdb/tdbutil.c b/source/tdb/tdbutil.c index c387644efc1..a620f085a90 100644 --- a/source/tdb/tdbutil.c +++ b/source/tdb/tdbutil.c @@ -127,7 +127,7 @@ size_t tdb_pack(char *buf, int bufsize, char *fmt, ...) uint32 d; int i; void *p; - int len=0; + int len; char *s; char c; char *buf0 = buf; @@ -188,6 +188,7 @@ size_t tdb_pack(char *buf, int bufsize, char *fmt, ...) default: DEBUG(0,("Unknown tdb_pack format %c in %s\n", c, fmt)); + len = 0; break; } @@ -213,7 +214,7 @@ int tdb_unpack(char *buf, int bufsize, char *fmt, ...) va_list ap; uint16 *w; uint32 *d; - int len=0; + int len; int *i; void **p; char *s, **b; @@ -272,6 +273,8 @@ int tdb_unpack(char *buf, int bufsize, char *fmt, ...) default: DEBUG(0,("Unknown tdb_unpack format %c in %s\n", c, fmt)); + + len = 0; break; } |