From 438619389fb8c465c96014481f5e81cfb9a8be40 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 24 Nov 2021 16:53:51 +0300 Subject: [PATCH] Fix build --- src/Common/renameat2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Common/renameat2.cpp b/src/Common/renameat2.cpp index acf7fd2bb09..41aeb8deca0 100644 --- a/src/Common/renameat2.cpp +++ b/src/Common/renameat2.cpp @@ -81,10 +81,10 @@ static bool renameat2(const std::string & old_path, const std::string & new_path return false; if (errno == EEXIST) - throwFromErrno(ErrorCodes::ATOMIC_RENAME_FAIL, "Cannot rename {} to {} because the second path already exists", old_path, new_path); + throwFromErrno(fmt::format("Cannot rename {} to {} because the second path already exists", old_path, new_path), ErrorCodes::ATOMIC_RENAME_FAIL); if (errno == ENOENT) - throwFromErrno(ErrorCodes::ATOMIC_RENAME_FAIL, "Paths cannot be exchanged because {} or {} does not exist", old_path, new_path); - throwFromErrnoWithPath("Cannot rename " + old_path + " to " + new_path, new_path, ErrorCodes::SYSTEM_ERROR); + throwFromErrno(fmt::format("Paths cannot be exchanged because {} or {} does not exist", old_path, new_path), ErrorCodes::ATOMIC_RENAME_FAIL); + throwFromErrnoWithPath(fmt::format("Cannot rename {} to {}", old_path, new_path), new_path, ErrorCodes::SYSTEM_ERROR); } bool supportsRenameat2()