diff options
author | Howard Chu <hyc@symas.com> | 2021-07-07 16:28:27 +0100 |
---|---|---|
committer | Howard Chu <hyc@symas.com> | 2022-06-03 16:46:47 +0100 |
commit | 033a32a20b100d8159a95da832e695e7b953de24 (patch) | |
tree | f99b73620c93a243304b8be77a8f26a45f3bcfb1 | |
parent | Revert "db_lmdb: test for mmap support at init time" (diff) | |
download | monero-033a32a20b100d8159a95da832e695e7b953de24.tar.xz |
Remove check is_directory check on lmdb path
The check interferes with raw device/partition support.
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 01f91209d..db7fa6c7c 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -1307,14 +1307,8 @@ void BlockchainLMDB::open(const std::string& filename, const int db_flags) throw0(DB_OPEN_FAILURE("Attempted to open db, but it's already open")); boost::filesystem::path direc(filename); - if (boost::filesystem::exists(direc)) - { - if (!boost::filesystem::is_directory(direc)) - throw0(DB_OPEN_FAILURE("LMDB needs a directory path, but a file was passed")); - } - else - { - if (!boost::filesystem::create_directories(direc)) + if (!boost::filesystem::exists(direc) && + !boost::filesystem::create_directories(direc)) { throw0(DB_OPEN_FAILURE(std::string("Failed to create directory ").append(filename).c_str())); } |