2010-10-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Simplified directory creation.
	* src/DHTAutoSaveCommand.cc
pull/1/head
Tatsuhiro Tsujikawa 2010-10-11 15:10:28 +00:00
parent b3036d5840
commit 8bfe35d3f2
2 changed files with 6 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2010-10-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Simplified directory creation.
* src/DHTAutoSaveCommand.cc
2010-10-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Skip ";" after name value pair.

View File

@ -91,22 +91,7 @@ void DHTAutoSaveCommand::save()
std::string tempFile = dhtFile;
tempFile += "__temp";
{
File f(tempFile);
if(!f.isFile()) {
File dir(f.getDirname());
if(!dir.exists()) {
if(!dir.mkdirs()) {
getLogger()->info(EX_MAKE_DIR,
dir.getPath().c_str(), strerror(errno));
return;
}
} else if(!dir.isDir()) {
getLogger()->info(EX_NOT_DIRECTORY, dir.getPath().c_str());
return;
}
}
}
File(tempFile).mkdirs();
std::vector<SharedHandle<DHTNode> > nodes;
std::vector<SharedHandle<DHTBucket> > buckets;
routingTable_->getBuckets(buckets);