From e9d87866c49acdba4118259fb05de2dafb4d698f Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Mon, 15 Oct 2012 17:04:11 +0200 Subject: [PATCH] mdb_env_open(): Keep mdb_env_set_flags() flags. --- libraries/libmdb/mdb.c | 1 + libraries/libmdb/mdb.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 07ecf99eba..cd2ad9a510 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -3155,6 +3155,7 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mode_t mode) sprintf(dpath, "%s" DATANAME, path); } + flags |= env->me_flags; /* silently ignore WRITEMAP if we're only getting read access */ if (F_ISSET(flags, MDB_RDONLY|MDB_WRITEMAP)) flags ^= MDB_WRITEMAP; diff --git a/libraries/libmdb/mdb.h b/libraries/libmdb/mdb.h index 1735fbd375..d78868cb08 100644 --- a/libraries/libmdb/mdb.h +++ b/libraries/libmdb/mdb.h @@ -401,6 +401,7 @@ int mdb_env_create(MDB_env **env); * @param[in] flags Special options for this environment. This parameter * must be set to 0 or by bitwise OR'ing together one or more of the * values described here. + * Flags set by mdb_env_set_flags() are also used. *