aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-03-21 14:44:48 +0100
committerDan Engelbrecht <[email protected]>2022-03-31 11:28:33 +0200
commit77a6d84f02617b0a19bb0c5d838f91f7a20eb264 (patch)
treed1c99ef9a74a1551eaa06157f12884ee9d7073eb
parentclang-format (diff)
downloadzen-77a6d84f02617b0a19bb0c5d838f91f7a20eb264.tar.xz
zen-77a6d84f02617b0a19bb0c5d838f91f7a20eb264.zip
linux fixes
-rw-r--r--zencore/iobuffer.cpp4
-rw-r--r--zenstore/basicfile.cpp6
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();