Skip to content

Commit

Permalink
Skip setting file pointer for write maps
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Feb 6, 2019
1 parent 0ed0ea0 commit 6df9039
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dependencies/lmdb/libraries/liblmdb/mdb.c
Expand Up @@ -3991,9 +3991,9 @@ mdb_env_map(MDB_env *env, void *addr)
* and won't map more than the file size.
* Just set the maxsize right now.
*/
if (SetFilePointer(env->me_fd, sizelo, &sizehi, 0) != (DWORD)sizelo
if (!(flags & MDB_WRITEMAP) && (SetFilePointer(env->me_fd, sizelo, &sizehi, 0) != (DWORD)sizelo
|| !SetEndOfFile(env->me_fd)
|| SetFilePointer(env->me_fd, 0, NULL, 0) != 0)
|| SetFilePointer(env->me_fd, 0, NULL, 0) != 0))
return ErrCode();
}

Expand Down

0 comments on commit 6df9039

Please sign in to comment.