From e3cb4b2d609aec4455846f70a276dc10608b6bb1 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 31 Mar 2020 16:15:53 -0600 Subject: [PATCH] Don't create conf dir in main() ensureConfig() does this implicitly. --- daemon/main.cpp | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/daemon/main.cpp b/daemon/main.cpp index bc12f8f33..785dff28a 100644 --- a/daemon/main.cpp +++ b/daemon/main.cpp @@ -195,20 +195,7 @@ main(int argc, char* argv[]) fs::path fname = fs::path(conffname); fs::path basedir = fname.parent_path(); - if (!basedir.empty()) - { - std::error_code ec; - if (!fs::create_directories(basedir, ec)) - { - if (ec) - { - llarp::LogError("failed to create '", basedir.string(), "': ", ec.message()); - return 1; - } - } - } - - if (genconfigOnly) + if(genconfigOnly) { llarp::ensureConfig(llarp::GetDefaultDataDir(), llarp::GetDefaultConfigPath(), @@ -230,21 +217,6 @@ main(int argc, char* argv[]) } else { - auto basepath = llarp::GetDefaultDataDir(); - - llarp::LogDebug("Find or create ", basepath.string()); - std::error_code ec; - // These paths are guaranteed to exist - $APPDATA or $HOME - // so only create .lokinet/* - if (!fs::create_directory(basepath, ec)) - { - if (ec) - { - llarp::LogError("failed to create '", basepath.string(), "': ", ec.message()); - return 1; - } - } - llarp::ensureConfig(llarp::GetDefaultDataDir(), llarp::GetDefaultConfigPath(), overwrite,