From f17cc1c6d80657fe8cd98891cf0bb1bbf3ac62bf Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 10 Jan 2018 15:03:39 -0800 Subject: cleanup --- controller/FileDB.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'controller/FileDB.cpp') diff --git a/controller/FileDB.cpp b/controller/FileDB.cpp index 6942a16e..40b9f914 100644 --- a/controller/FileDB.cpp +++ b/controller/FileDB.cpp @@ -23,12 +23,13 @@ namespace ZeroTier FileDB::FileDB(EmbeddedNetworkController *const nc,const Identity &myId,const char *path) : DB(nc,myId,path), - _networksPath(_path + ZT_PATH_SEPARATOR_S + "network") + _networksPath(_path + ZT_PATH_SEPARATOR_S + "network"), + _tracePath(_path + ZT_PATH_SEPARATOR_S + "trace") { OSUtils::mkdir(_path.c_str()); OSUtils::lockDownFile(_path.c_str(),true); - OSUtils::mkdir((_path + ZT_PATH_SEPARATOR + "network").c_str()); - OSUtils::mkdir((_path + ZT_PATH_SEPARATOR + "trace").c_str()); + OSUtils::mkdir(_networksPath.c_str()); + OSUtils::mkdir(_tracePath.c_str()); std::vector networks(OSUtils::listDirectory(_networksPath.c_str(),false)); std::string buf; @@ -120,7 +121,7 @@ void FileDB::save(nlohmann::json *orig,nlohmann::json &record) } else if (objtype == "trace") { const std::string id = record["id"]; if (id.length() > 0) { - OSUtils::ztsnprintf(p1,sizeof(p1),"%s" ZT_PATH_SEPARATOR_S "trace" ZT_PATH_SEPARATOR_S "%s.json",_path.c_str(),id.c_str()); + OSUtils::ztsnprintf(p1,sizeof(p1),"%s" ZT_PATH_SEPARATOR_S "%s.json",_tracePath.c_str(),id.c_str()); OSUtils::writeFile(p1,OSUtils::jsonDump(record,-1)); } } -- cgit v1.2.3