Skip to content

Commit 94fe141

Browse files
committed
util: Avoid buggy std::filesystem:::create_directories() call
Compiled with some libstdc++ versions (e.g., on Ubuntu 20.04) std::filesystem:::create_directories() call fails to handle symbol links properly.
1 parent b2a8371 commit 94fe141

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/util/system.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,10 @@ const fs::path& ArgsManager::GetDataDir(bool net_specific) const
443443
} else {
444444
path = GetDefaultDataDir();
445445
}
446-
if (net_specific)
447-
path /= fs::PathFromString(BaseParams().DataDir());
448446

449-
if (fs::create_directories(path)) {
450-
// This is the first run, create wallets subdirectory too
447+
fs::create_directories(path / "wallets");
448+
if (net_specific && !BaseParams().DataDir().empty()) {
449+
path /= fs::PathFromString(BaseParams().DataDir());
451450
fs::create_directories(path / "wallets");
452451
}
453452

0 commit comments

Comments
 (0)