Browse Source

fix bug

master
Martin Dørum 3 years ago
parent
commit
3f194797ed
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/sys.cc

+ 4
- 2
src/sys.cc View File

@@ -18,6 +18,8 @@

namespace sys {

static thread_local std::unordered_set<std::string> mkdirp_set;

FileInfo fileInfo(const std::string &path) {
FileInfo finfo;

@@ -46,8 +48,7 @@ bool fileExists(const std::string &path) {
}

void mkdirp(const std::string &path) {
static thread_local std::unordered_set<std::string> set;
auto res = set.emplace(path);
auto res = mkdirp_set.emplace(path);
if (!res.second)
return;

@@ -61,6 +62,7 @@ void mkdirp(const std::string &path) {
}

void rmrf(const std::string &path) {
mkdirp_set.erase(path);
// TODO: Implement this in C++ instead
std::vector<std::string> argv;
argv.push_back("rm");

Loading…
Cancel
Save