mirror of https://github.com/Icinga/icinga2.git
Ensure to _unlink before renaming replay log on Windows
This commit is contained in:
parent
1b2af3f0c4
commit
a1c2eb3d87
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue