From: Howard Chu Date: Fri, 4 Oct 2013 09:46:38 +0000 (-0700) Subject: ITS#7715 always set filesize for WRITEMAP X-Git-Tag: OPENLDAP_REL_ENG_2_4_37~27^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2520247ba156ae2f881c800ccc47792c622725ae;p=openldap ITS#7715 always set filesize for WRITEMAP --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index d1cd8643fc..0aae740614 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -3272,7 +3272,7 @@ mdb_env_map(MDB_env *env, void *addr, int newsize) int prot = PROT_READ; if (flags & MDB_WRITEMAP) { prot |= PROT_WRITE; - if (newsize && ftruncate(env->me_fd, env->me_mapsize) < 0) + if (ftruncate(env->me_fd, env->me_mapsize) < 0) return ErrCode(); } env->me_map = mmap(addr, env->me_mapsize, prot, MAP_SHARED,