diff options
author | Kris Zyp <kriszyp@gmail.com> | 2020-11-02 20:33:09 +0000 |
---|---|---|
committer | Howard Chu <hyc@symas.com> | 2022-06-03 16:46:59 +0100 |
commit | ade464a5a0adaa166171f803078e9ac31b99bb06 (patch) | |
tree | 71a62959c3b009def14e5f2ab787093fa433994b /external/db_drivers/liblmdb | |
parent | Remove check is_directory check on lmdb path (diff) | |
download | monero-ade464a5a0adaa166171f803078e9ac31b99bb06.tar.xz |
ITS#9385 fix using MDB_NOSUBDIR with nonexistent file
Diffstat (limited to 'external/db_drivers/liblmdb')
-rw-r--r-- | external/db_drivers/liblmdb/mdb.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/external/db_drivers/liblmdb/mdb.c b/external/db_drivers/liblmdb/mdb.c index f29a75de8..bf60c7013 100644 --- a/external/db_drivers/liblmdb/mdb.c +++ b/external/db_drivers/liblmdb/mdb.c @@ -5495,11 +5495,8 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode #ifndef _WIN32 { struct stat st; - rc = stat(path, &st); - if (rc) - return ErrCode(); 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; if (!env->me_mapsize) env->me_mapsize = DEFAULT_MAPSIZE; |