未验证 提交 7b2691bf 编写于 作者: V Vitaly Baranov 提交者: GitHub

Merge pull request #17727 from ClickHouse/backport/20.12/17664

Backport #17664 to 20.12: Fix renameat2 ENOSYS on WSL
......@@ -67,6 +67,10 @@ static bool renameat2(const std::string & old_path, const std::string & new_path
/// Other cases when EINVAL can be returned should never happen.
if (errno == EINVAL)
return false;
/// We should never get ENOSYS on Linux, because we check kernel version in supportsRenameat2Impl().
/// However, we can get in on WSL.
if (errno == ENOSYS)
return false;
if (errno == EEXIST)
throwFromErrno("Cannot rename " + old_path + " to " + new_path + " because the second path already exists", ErrorCodes::ATOMIC_RENAME_FAIL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册