mirror of https://github.com/Icinga/icinga2.git
Merge pull request #6639 from Icinga/fix/windows-api-log-rename
Ensure to _unlink before renaming replay log on Windows
This commit is contained in:
commit
64e273afdd
|
@ -1086,6 +1086,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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue