mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
ITS#9385 fix using MDB_NOSUBDIR with nonexistent file
This commit is contained in:
parent
033a32a20b
commit
ade464a5a0
1 changed files with 1 additions and 4 deletions
5
external/db_drivers/liblmdb/mdb.c
vendored
5
external/db_drivers/liblmdb/mdb.c
vendored
|
@ -5495,11 +5495,8 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
rc = stat(path, &st);
|
|
||||||
if (rc)
|
|
||||||
return ErrCode();
|
|
||||||
flags &= ~MDB_RAWPART;
|
flags &= ~MDB_RAWPART;
|
||||||
if (S_ISBLK(st.st_mode)) {
|
if (!stat(path, &st) && (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode))) {
|
||||||
flags |= MDB_RAWPART | MDB_NOSUBDIR;
|
flags |= MDB_RAWPART | MDB_NOSUBDIR;
|
||||||
if (!env->me_mapsize)
|
if (!env->me_mapsize)
|
||||||
env->me_mapsize = DEFAULT_MAPSIZE;
|
env->me_mapsize = DEFAULT_MAPSIZE;
|
||||||
|
|
Loading…
Reference in a new issue