From 2520247ba156ae2f881c800ccc47792c622725ae Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 4 Oct 2013 02:46:38 -0700 Subject: [PATCH] ITS#7715 always set filesize for WRITEMAP --- libraries/liblmdb/mdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.39.5