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()); }