Skip to content

Commit

Permalink
use fs::mv() instead of fs::rename()
Browse files Browse the repository at this point in the history
  • Loading branch information
idealvin committed Nov 6, 2023
1 parent ecdf5ee commit b5facb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/log/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b5facb7

Please sign in to comment.