mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Use header when some fields are unspecified
This commit is contained in:
parent
d620d4368a
commit
0c2610ebdd
@ -782,6 +782,7 @@ mdbenv_read_meta(MDB_env *env, pgno_t *p_next)
|
|||||||
if (size == env->me_head.mh_psize) { /* there is only the header */
|
if (size == env->me_head.mh_psize) { /* there is only the header */
|
||||||
if (p_next != NULL)
|
if (p_next != NULL)
|
||||||
*p_next = 1;
|
*p_next = 1;
|
||||||
|
env->me_meta.mm_stat.ms_psize = env->me_head.mh_psize;
|
||||||
return MDB_SUCCESS; /* new file */
|
return MDB_SUCCESS; /* new file */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -846,8 +847,6 @@ mdbenv_create(MDB_env **env, size_t size)
|
|||||||
{
|
{
|
||||||
MDB_env *e;
|
MDB_env *e;
|
||||||
|
|
||||||
if (!size) return EINVAL;
|
|
||||||
|
|
||||||
e = calloc(1, sizeof(*e));
|
e = calloc(1, sizeof(*e));
|
||||||
if (!e) return ENOMEM;
|
if (!e) return ENOMEM;
|
||||||
|
|
||||||
@ -879,6 +878,9 @@ mdbenv_open2(MDB_env *env, unsigned int flags)
|
|||||||
newenv = 1;
|
newenv = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!env->me_mapsize)
|
||||||
|
env->me_mapsize = env->me_head.mh_mapsize;
|
||||||
|
|
||||||
i = MAP_SHARED;
|
i = MAP_SHARED;
|
||||||
if (env->me_head.mh_address && (flags & MDB_FIXEDMAP))
|
if (env->me_head.mh_address && (flags & MDB_FIXEDMAP))
|
||||||
i |= MAP_FIXED;
|
i |= MAP_FIXED;
|
||||||
|
Loading…
Reference in New Issue
Block a user