From b5facb79b74cf83b94519d809a8ced50b5353f2b Mon Sep 17 00:00:00 2001 From: idealvin Date: Mon, 6 Nov 2023 22:51:32 +0800 Subject: [PATCH] use fs::mv() instead of fs::rename() --- src/log/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/log/log.cc b/src/log/log.cc index a24ee5f8d..9b93f3b5a 100644 --- a/src/log/log.cc +++ b/src/log/log.cc @@ -286,7 +286,7 @@ fs::file& LogFile::open(const char* topic, int level) { auto& path = _old_paths.back(); if (fs::fsize(_path) >= FLG_max_log_file_size || ( FLG_log_daily && get_day_from_path(path) != _day)) { - fs::rename(_path, path); // rename xx.log to xx_0808_15_30_08.123.log + fs::mv(_path, path); // rename xx.log to xx_0808_15_30_08.123.log if (FLG_log_compress) compress_file(path); new_file = true; }