Ensure to _unlink before renaming replay log on Windows

This commit is contained in:
Michael Friedrich 2018-06-22 11:12:09 +02:00
parent 1b2af3f0c4
commit a1c2eb3d87
1 changed files with 7 additions and 0 deletions

View File

@ -1046,6 +1046,13 @@ void ApiListener::RotateLogFile()
String oldpath = GetApiDir() + "log/current";
String newpath = GetApiDir() + "log/" + Convert::ToString(static_cast<int>(ts)+1);
#ifdef _WIN32
_unlink(newpath.CStr());
#endif /* _WIN32 */
(void) rename(oldpath.CStr(), newpath.CStr());
}