From 88133860d74ee5d664cac070b5e53c24cc1dbf45 Mon Sep 17 00:00:00 2001 From: tavplubix Date: Tue, 1 Dec 2020 13:22:29 +0300 Subject: [PATCH] Update renameat2.cpp --- src/Common/renameat2.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Common/renameat2.cpp b/src/Common/renameat2.cpp index 24e414122dc..a735a9d72d4 100644 --- a/src/Common/renameat2.cpp +++ b/src/Common/renameat2.cpp @@ -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);