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

View file

@ -154,7 +154,7 @@ namespace tools
#else
#define MKDIR(path, mode) mkdir(path, mode)
#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
LOG_ERROR(tr("Failed to create directory ") + m_wallet_dir);