diff options
Diffstat (limited to 'contrib/epee/src/mlog.cpp')
-rw-r--r-- | contrib/epee/src/mlog.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/epee/src/mlog.cpp b/contrib/epee/src/mlog.cpp index cd9867ff5..61d853ef4 100644 --- a/contrib/epee/src/mlog.cpp +++ b/contrib/epee/src/mlog.cpp @@ -137,7 +137,12 @@ void mlog_configure(const std::string &filename_base, bool console, const std::s el::Loggers::addFlag(el::LoggingFlag::StrictLogFileSizeCheck); el::Helpers::installPreRollOutCallback([filename_base, max_log_files](const char *name, size_t){ std::string rname = generate_log_filename(filename_base.c_str()); - rename(name, rname.c_str()); + int ret = rename(name, rname.c_str()); + if (ret < 0) + { + // can't log a failure, but don't do the file removal below + return; + } if (max_log_files != 0) { std::vector<boost::filesystem::path> found_files; |