diff options
author | Simo Sorce <idra@samba.org> | 2008-09-25 01:51:49 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-09-25 02:30:18 -0400 |
commit | f698831f0ae0cd86225eb647ae4aeb813f08d3b5 (patch) | |
tree | 55689de966245292e6ae517480c668ce993caf70 /tdb/common | |
parent | cced59be44cbc2204314bdf77a35b41b81bf4097 (diff) | |
download | sssd-f698831f0ae0cd86225eb647ae4aeb813f08d3b5.tar.gz sssd-f698831f0ae0cd86225eb647ae4aeb813f08d3b5.tar.bz2 sssd-f698831f0ae0cd86225eb647ae4aeb813f08d3b5.zip |
Sync with upstream changes
Diffstat (limited to 'tdb/common')
-rw-r--r-- | tdb/common/io.c | 4 | ||||
-rw-r--r-- | tdb/common/tdb.c | 2 | ||||
-rw-r--r-- | tdb/common/transaction.c | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/tdb/common/io.c b/tdb/common/io.c index 172ab69d..661f7614 100644 --- a/tdb/common/io.c +++ b/tdb/common/io.c @@ -189,7 +189,9 @@ int tdb_munmap(struct tdb_context *tdb) #ifdef HAVE_MMAP if (tdb->map_ptr) { - int ret = munmap(tdb->map_ptr, tdb->map_size); + int ret; + + ret = munmap(tdb->map_ptr, tdb->map_size); if (ret != 0) return ret; } diff --git a/tdb/common/tdb.c b/tdb/common/tdb.c index 767452c9..c7cec297 100644 --- a/tdb/common/tdb.c +++ b/tdb/common/tdb.c @@ -243,7 +243,7 @@ int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct list_struct if (tdb->read_only || tdb->traverse_read) return -1; - if (tdb->traverse_write != 0 || + if (((tdb->traverse_write != 0) && (!TDB_DEAD(rec))) || tdb_write_lock_record(tdb, rec_ptr) == -1) { /* Someone traversing here: mark it as dead */ rec->magic = TDB_DEAD_MAGIC; diff --git a/tdb/common/transaction.c b/tdb/common/transaction.c index 4e2127be..7acda640 100644 --- a/tdb/common/transaction.c +++ b/tdb/common/transaction.c @@ -563,7 +563,7 @@ static int transaction_sync(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction: fsync failed\n")); return -1; } -#ifdef MS_SYNC +#ifdef HAVE_MMAP if (tdb->map_ptr) { tdb_off_t moffset = offset & ~(tdb->page_size-1); if (msync(moffset + (char *)tdb->map_ptr, |