]> granicus.if.org Git - icinga2/commitdiff
Ensure to _unlink before renaming replay log on Windows 6639/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Fri, 22 Jun 2018 09:12:09 +0000 (11:12 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Fri, 22 Jun 2018 09:12:09 +0000 (11:12 +0200)
lib/remote/apilistener.cpp

index c1546710d0a84b80450a804846c06df391ec8bea..fda3d9a943fd94798fb597ba79474d48cdfca38a 100644 (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());
 }