From: Michael Friedrich Date: Fri, 22 Jun 2018 09:12:09 +0000 (+0200) Subject: Ensure to _unlink before renaming replay log on Windows X-Git-Tag: v2.10.0~20^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a1c2eb3d8764718c30d36a3a59cb86b46116c3c5;p=icinga2 Ensure to _unlink before renaming replay log on Windows --- diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index c1546710d..fda3d9a94 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -1046,6 +1046,13 @@ void ApiListener::RotateLogFile() String oldpath = GetApiDir() + "log/current"; String newpath = GetApiDir() + "log/" + Convert::ToString(static_cast(ts)+1); + + +#ifdef _WIN32 + _unlink(newpath.CStr()); +#endif /* _WIN32 */ + + (void) rename(oldpath.CStr(), newpath.CStr()); }