Don't try to create wallet-dir when it's not given, don't crash if wallet-dir already exists.

This commit is contained in:
Michał Sałaban 2017-10-07 02:04:33 +02:00
parent 86e9de588c
commit 2183ade0c4
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ namespace tools
#else #else
#define MKDIR(path, mode) mkdir(path, mode) #define MKDIR(path, mode) mkdir(path, mode)
#endif #endif
if (MKDIR(m_wallet_dir.c_str(), 0700) < 0) if (!m_wallet_dir.empty() && MKDIR(m_wallet_dir.c_str(), 0700) < 0 && errno != EEXIST)
{ {
#ifdef _WIN32 #ifdef _WIN32
LOG_ERROR(tr("Failed to create directory ") + m_wallet_dir); LOG_ERROR(tr("Failed to create directory ") + m_wallet_dir);