Skip to content

Commit dfa07db

Browse files
committed
fix(util.fs): 修复Rename()函数不打印错误日志的问题
1 parent 5ad9e4c commit dfa07db

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/util/fs.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,8 @@ bool Rename(const std::string &old_name, const std::string &new_name)
436436
if (ret == 0)
437437
return true;
438438

439-
if (errno != ENOENT)
440-
LogWarn("errno:%d (%s)", errno, strerror(errno));
441-
439+
LogWarn("rename '%s' to '%s' fail, errno:%d (%s)",
440+
old_name.c_str(), new_name.c_str(), errno, strerror(errno));
442441
return false;
443442
}
444443

0 commit comments

Comments
 (0)