From a1c2eb3d8764718c30d36a3a59cb86b46116c3c5 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 22 Jun 2018 11:12:09 +0200 Subject: [PATCH] Ensure to _unlink before renaming replay log on Windows --- lib/remote/apilistener.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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()); } -- 2.40.0