mdb_env_open(): Keep mdb_env_set_flags() flags.

vmware
Hallvard Furuseth 12 years ago
parent 092f9a5c66
commit e9d87866c4
  1. 1
      libraries/libmdb/mdb.c
  2. 3
      libraries/libmdb/mdb.h

@ -3155,6 +3155,7 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mode_t mode)
sprintf(dpath, "%s" DATANAME, path); sprintf(dpath, "%s" DATANAME, path);
} }
flags |= env->me_flags;
/* silently ignore WRITEMAP if we're only getting read access */ /* silently ignore WRITEMAP if we're only getting read access */
if (F_ISSET(flags, MDB_RDONLY|MDB_WRITEMAP)) if (F_ISSET(flags, MDB_RDONLY|MDB_WRITEMAP))
flags ^= MDB_WRITEMAP; flags ^= MDB_WRITEMAP;

@ -401,6 +401,7 @@ int mdb_env_create(MDB_env **env);
* @param[in] flags Special options for this environment. This parameter * @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 * must be set to 0 or by bitwise OR'ing together one or more of the
* values described here. * values described here.
* Flags set by mdb_env_set_flags() are also used.
* <ul> * <ul>
* <li>#MDB_FIXEDMAP * <li>#MDB_FIXEDMAP
* use a fixed address for the mmap region. This flag must be specified * use a fixed address for the mmap region. This flag must be specified
@ -501,7 +502,7 @@ void mdb_env_close(MDB_env *env);
/** @brief Set environment flags. /** @brief Set environment flags.
* *
* This may be used to set some flags that weren't already set during * This may be used to set some flags in addition to those from
* #mdb_env_open(), or to unset these flags. * #mdb_env_open(), or to unset these flags.
* @param[in] env An environment handle returned by #mdb_env_create() * @param[in] env An environment handle returned by #mdb_env_create()
* @param[in] flags The flags to change, bitwise OR'ed together * @param[in] flags The flags to change, bitwise OR'ed together

Loading…
Cancel
Save