diff options
| -rw-r--r-- | zenstore/basicfile.cpp | 12 | ||||
| -rw-r--r-- | zenstore/gc.cpp | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/zenstore/basicfile.cpp b/zenstore/basicfile.cpp index 731aacc69..6e60c6e9c 100644 --- a/zenstore/basicfile.cpp +++ b/zenstore/basicfile.cpp @@ -352,10 +352,10 @@ BasicFile::SetFileSize(uint64_t FileSize) ThrowSystemError(Error, fmt::format("Failed to set truncate file to {} for file {}", FileSize, PathFromHandle(m_FileHandle))); } } - std::error_code Ec = posix_fallocate(Fd, 0, (off_t)FileSize); - if (Ec) + int Error = posix_fallocate(Fd, 0, (off_t)FileSize); + if (Error) { - ThrowSystemError(Ec, fmt::format("Failed to allocate space of {} for file {}", FileSize, PathFromHandle(m_FileHandle))) + ThrowSystemError(Error, fmt::format("Failed to allocate space of {} for file {}", FileSize, PathFromHandle(m_FileHandle))) } #else int Fd = int(intptr_t(m_FileHandle)); @@ -367,10 +367,10 @@ BasicFile::SetFileSize(uint64_t FileSize) ThrowSystemError(Error, fmt::format("Failed to set truncate file to {} for file {}", FileSize, PathFromHandle(m_FileHandle))); } } - std::error_code Ec = posix_fallocate64(Fd, 0, (off64_t)FileSize); - if (Ec) + int Error = posix_fallocate64(Fd, 0, (off64_t)FileSize); + if (Error) { - ThrowSystemError(Ec, fmt::format("Failed to allocate space of {} for file {}", FileSize, PathFromHandle(m_FileHandle))) + ThrowSystemError(Error, fmt::format("Failed to allocate space of {} for file {}", FileSize, PathFromHandle(m_FileHandle))) } #endif } diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp index 311f7ced4..ac9beac63 100644 --- a/zenstore/gc.cpp +++ b/zenstore/gc.cpp @@ -123,20 +123,20 @@ namespace { { return MakeErrorCodeFromLastError(); } - std::error_code Ec = posix_fallocate(Fd, 0, (off_t)Size); - if (Ec) + int Error = posix_fallocate(Fd, 0, (off_t)Size); + if (Error) { - return Ec; + return MakeErrorCode(Error); } # else if (ftruncate64(Fd, (off64_t)Size) < 0) { return MakeErrorCodeFromLastError(); } - std::error_code Ec = posix_fallocate64(Fd, 0, (off64_t)Size); - if (Ec) + int Error = posix_fallocate64(Fd, 0, (off64_t)Size); + if (Error) { - return Ec; + return MakeErrorCode(Error); } # endif Keep = true; |