]> git.sur5r.net Git - openldap/commitdiff
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
authorQuanah Gibson-Mount <quanah@openldap.org>
Mon, 11 Aug 2014 18:45:00 +0000 (13:45 -0500)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 11 Aug 2014 18:45:00 +0000 (13:45 -0500)
libraries/liblmdb/CHANGES
libraries/liblmdb/mdb.c

index 644b18de97cd92a0acde8914fe24f8a08cf248de..11dc2ec864bc4ed9a413bacff4ec32d9bbb4a561 100644 (file)
@@ -9,6 +9,7 @@ LMDB 0.9.14 Engineering
        Fix mdb_copy copying past end of file (ITS#7886)
        Fix cursor bugs from page_merge/rebalance
        Fix to dirty fewer pages in deletes (mdb_page_loose())
+       Fix mdb_dbi_open creating subDBs (ITS#7917)
        Fix Windows compat issues in mtests (ITS#7879)
        Add compacting variant of mdb_copy
        Add BigEndian integer key compare code
index 8b560ed32e238a71bff0529907232ecc630701a9..47a503636c8e2d5712a5b541dfec5a5087f1e4cf 100644 (file)
@@ -85,6 +85,7 @@ extern int cacheflush(char *addr, int nbytes, int cache);
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <malloc.h>
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
@@ -8469,9 +8470,9 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd)
 #else
        pthread_mutex_init(&my.mc_mutex, NULL);
        pthread_cond_init(&my.mc_cond, NULL);
-       rc = posix_memalign((void **)&my.mc_wbuf[0], env->me_os_psize, MDB_WBUF*2);
-       if (rc)
-               return rc;
+       my.mc_wbuf[0] = memalign(env->me_os_psize, MDB_WBUF*2);
+       if (my.mc_wbuf[0] == NULL)
+               return errno;
 #endif
        memset(my.mc_wbuf[0], 0, MDB_WBUF*2);
        my.mc_wbuf[1] = my.mc_wbuf[0] + MDB_WBUF;
@@ -8891,6 +8892,7 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *db
        MDB_val key, data;
        MDB_dbi i;
        MDB_cursor mc;
+       MDB_db dummy;
        int rc, dbflag, exact;
        unsigned int unused = 0, seq;
        size_t len;
@@ -8960,7 +8962,6 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *db
                        return MDB_INCOMPATIBLE;
        } else if (rc == MDB_NOTFOUND && (flags & MDB_CREATE)) {
                /* Create if requested */
-               MDB_db dummy;
                data.mv_size = sizeof(MDB_db);
                data.mv_data = &dummy;
                memset(&dummy, 0, sizeof(dummy));