From 64fc67f4ae56fc0f67e069254a24747ae83814d6 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Mon, 2 Nov 2020 20:33:09 +0000 Subject: [PATCH] ITS#9385 fix using MDB_NOSUBDIR with nonexistent file --- libraries/liblmdb/mdb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 72c4c43..befc70b 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -5995,11 +5995,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) || S_ISCHR(st.st_mode)) + if (!stat(path, &st) && (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode))) flags |= MDB_RAWPART | MDB_NOSUBDIR; } #endif