Skip to content

Commit

Permalink
Merge pull request #630 from UdjinM6/fix629
Browse files Browse the repository at this point in the history
fix N5boost10filesystem16filesystem_errorE on freebsd
  • Loading branch information
evan82 committed Oct 2, 2015
2 parents 27a4f5e + 2f8c944 commit 91781c2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,11 +914,13 @@ bool AppInit2(boost::thread_group& threadGroup)
boost::filesystem::path backupFile = backupPathStr + dateTimeStr;
sourceFile.make_preferred();
backupFile.make_preferred();
try {
boost::filesystem::copy_file(sourceFile, backupFile);
LogPrintf("Creating backup of %s -> %s\n", sourceFile, backupFile);
} catch(boost::filesystem::filesystem_error &error) {
LogPrintf("Failed to create backup %s\n", error.what());
if(boost::filesystem::exists(sourceFile)) {
try {
boost::filesystem::copy_file(sourceFile, backupFile);
LogPrintf("Creating backup of %s -> %s\n", sourceFile, backupFile);
} catch(boost::filesystem::filesystem_error &error) {
LogPrintf("Failed to create backup %s\n", error.what());
}
}
// Keep only the last 10 backups, including the new one of course
typedef std::multimap<std::time_t, boost::filesystem::path> folder_set_t;
Expand Down

0 comments on commit 91781c2

Please sign in to comment.