From 43d6a0ad8650e4df84ef5e35029e7fd265ba9666 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 19 Apr 2013 00:39:10 -0700 Subject: [PATCH] Complete the log rotate even if we can't rename the existing log file. --- src/cpp/ripple/Log.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cpp/ripple/Log.cpp b/src/cpp/ripple/Log.cpp index dfef66797d..5d3366a96a 100644 --- a/src/cpp/ripple/Log.cpp +++ b/src/cpp/ripple/Log.cpp @@ -109,7 +109,15 @@ std::string Log::rotateLog(void) } while (boost::filesystem::exists(boost::filesystem::path(abs_new_path_str))); outStream->close(); - boost::filesystem::rename(abs_path, boost::filesystem::path(abs_new_path_str)); + + try + { + boost::filesystem::rename(abs_path, boost::filesystem::path(abs_new_path_str)); + } + catch (...) + { + // unable to rename existing log file + } setLogFile(*pathToLog);