Commit 0ee21a48 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

Merge remote-tracking branch 'origin/mdb.RE/0.9' into OPENLDAP_REL_ENG_2_4

parents 34c61739 7d0c4b4c
LMDB 0.9 Change Log
LMDB 0.9.25 Engineering
ITS#9068 fix mdb_dump/load backslashes in printable content
ITS#9118 add MAP_NOSYNC for FreeBSD
LMDB 0.9.24 Release (2019/07/24)
ITS#8969 Tweak mdb_page_split
ITS#8975 WIN32 fix writemap set_mapsize crash
......
......@@ -4010,13 +4010,18 @@ mdb_env_map(MDB_env *env, void *addr)
if (rc)
return rc;
#else
int mmap_flags = MAP_SHARED:
int prot = PROT_READ;
#ifdef MAP_NOSYNC /* Used on FreeBSD */
if (flags & MDB_NOSYNC)
mmap_flags |= MAP_NOSYNC;
#endif
if (flags & MDB_WRITEMAP) {
prot |= PROT_WRITE;
if (ftruncate(env->me_fd, env->me_mapsize) < 0)
return ErrCode();
}
env->me_map = mmap(addr, env->me_mapsize, prot, MAP_SHARED,
env->me_map = mmap(addr, env->me_mapsize, prot, mmap_flags,
env->me_fd, 0);
if (env->me_map == MAP_FAILED) {
env->me_map = NULL;
......
......@@ -68,6 +68,8 @@ static void text(MDB_val *v)
end = c + v->mv_size;
while (c < end) {
if (isprint(*c)) {
if (*c == '\\')
putchar('\\');
putchar(*c);
} else {
putchar('\\');
......
......@@ -238,7 +238,7 @@ badend:
while (c2 < end) {
if (*c2 == '\\') {
if (c2[1] == '\\') {
c1++; c2 += 2;
*c1++ = *c2;
} else {
if (c2+3 > end || !isxdigit(c2[1]) || !isxdigit(c2[2])) {
Eof = 1;
......@@ -246,8 +246,8 @@ badend:
return EOF;
}
*c1++ = unhex(++c2);
c2 += 2;
}
c2 += 2;
} else {
/* copies are redundant when no escapes were used */
*c1++ = *c2++;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment