diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-08-08 10:06:39 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-08-08 10:06:39 -0400 |
| commit | 86056fdbd923fbf55f85b3db704bba021ea90c4f (patch) | |
| tree | 1e8e46bf3fe85bf6ab9c91a98294479cf7e37626 /node/Network.cpp | |
| parent | 8a46452a700fa5a8d6fc3bd9308bf483cd715de1 (diff) | |
| download | infinitytier-86056fdbd923fbf55f85b3db704bba021ea90c4f.tar.gz infinitytier-86056fdbd923fbf55f85b3db704bba021ea90c4f.zip | |
Generalize unlink to OS-dep code in Utils, just a little prep for Windows port.
Diffstat (limited to 'node/Network.cpp')
| -rw-r--r-- | node/Network.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/node/Network.cpp b/node/Network.cpp index 127de917..94eef23f 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -111,8 +111,8 @@ Network::~Network() if (_destroyOnDelete) { std::string confPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + toString() + ".conf"); std::string mcdbPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + toString() + ".mcerts"); - unlink(confPath.c_str()); - unlink(mcdbPath.c_str()); + Utils::rm(confPath); + Utils::rm(mcdbPath); } else { // Causes flush of membership certs to disk clean(); @@ -204,7 +204,7 @@ void Network::clean() Mutex::Lock _l(_lock); if (_configuration.isOpen()) { _membershipCertificates.clear(); - unlink(mcdbPath.c_str()); + Utils::rm(mcdbPath); } else { FILE *mcdb = fopen(mcdbPath.c_str(),"wb"); bool writeError = false; @@ -236,7 +236,7 @@ void Network::clean() if (mcdb) fclose(mcdb); if (writeError) { - unlink(mcdbPath.c_str()); + Utils::rm(mcdbPath); LOG("error: unable to write to membership cert database at: %s",mcdbPath.c_str()); } } |
