mdbx: env_open() consider zero mode_t as open-existing flag.

Change-Id: I6f9dbf2059822afaba4c3de8f4ce380613a7dc36
This commit is contained in:
Leonid Yuriev 2019-03-01 13:29:15 +03:00
parent 7617cce0c6
commit 01797cf1bc

View File

@ -6489,8 +6489,10 @@ int __cold mdbx_env_open(MDBX_env *env, const char *path, unsigned flags,
int oflags;
if (F_ISSET(flags, MDBX_RDONLY))
oflags = O_RDONLY;
else
else if (mode != 0)
oflags = O_RDWR | O_CREAT;
else
oflags = O_RDWR;
rc = mdbx_openfile(dxb_pathname, oflags, mode, &env->me_fd,
(env->me_flags & MDBX_EXCLUSIVE) ? true : false);