diff options
| -rw-r--r-- | zencore/iobuffer.cpp | 4 | ||||
| -rw-r--r-- | zenstore/basicfile.cpp | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/zencore/iobuffer.cpp b/zencore/iobuffer.cpp index e684663a9..f5cfafff9 100644 --- a/zencore/iobuffer.cpp +++ b/zencore/iobuffer.cpp @@ -217,11 +217,9 @@ IoBufferExtendedCore::~IoBufferExtendedCore() int Fd = int(uintptr_t(m_FileHandle)); bool Success = (close(Fd) == 0); #endif - if (!Success) { - DWORD LastError = GetLastError(); - ZEN_WARN("Error reported on file handle close, reason {}", GetSystemErrorAsString(LastError)); + ZEN_WARN("Error reported on file handle close, reason {}", GetLastErrorAsString()); } } diff --git a/zenstore/basicfile.cpp b/zenstore/basicfile.cpp index efa91f107..7d5b659c9 100644 --- a/zenstore/basicfile.cpp +++ b/zenstore/basicfile.cpp @@ -289,10 +289,10 @@ BasicFile::SetFileSize(uint64_t FileSize) ::SetEndOfFile(m_FileHandle); #elif ZEN_PLATFORM_MAC int Fd = int(intptr_t(m_FileHandle)); - ftruncate(fileno(Fd), (off_t)FileSize); + ftruncate(Fd, (off_t)FileSize); #else int Fd = int(intptr_t(m_FileHandle)); - ftruncate64(fileno(Fd), (off64_t)FileSize); + ftruncate64(Fd, (off64_t)FileSize); #endif } @@ -309,7 +309,7 @@ BasicFile::MarkAsDeleteOnClose(std::error_code& Ec) Ec = MakeErrorCodeFromLastError(); } #elif ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC - std::filesystem::path SourcePath = PathFromHandle(FileRef.FileHandle); + std::filesystem::path SourcePath = PathFromHandle(m_FileHandle); if (unlink(SourcePath.c_str()) < 0) { int UnlinkError = zen::GetLastError(); |