mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 01:42:27 +00:00
wallet_rpc_server: catch failure to create directory
CID 175281
This commit is contained in:
parent
3e55099cb2
commit
54cc209a5e
1 changed files with 10 additions and 1 deletions
|
@ -27,6 +27,7 @@
|
|||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/asio/ip/address.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <cstdint>
|
||||
|
@ -153,7 +154,15 @@ namespace tools
|
|||
#else
|
||||
#define MKDIR(path, mode) mkdir(path, mode)
|
||||
#endif
|
||||
MKDIR(m_wallet_dir.c_str(), 0700);
|
||||
if (MKDIR(m_wallet_dir.c_str(), 0700) < 0)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
LOG_ERROR(tr("Failed to create directory ") + m_wallet_dir);
|
||||
#else
|
||||
LOG_ERROR((boost::format(tr("Failed to create directory %s: %s")) % m_wallet_dir % strerror(errno)).str());
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (disable_auth)
|
||||
|
|
Loading…
Reference in a new issue