aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/filesystem.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-04 17:23:36 +0100
committerGitHub Enterprise <[email protected]>2026-03-04 17:23:36 +0100
commit1f83b48a20bf90f41e18867620c5774f3be6280d (patch)
treead2b948dfd64ff55249a361ba018e6771de041d7 /src/zencore/filesystem.cpp
parentmore feedback during auth option parsing (#806) (diff)
downloadzen-1f83b48a20bf90f41e18867620c5774f3be6280d.tar.xz
zen-1f83b48a20bf90f41e18867620c5774f3be6280d.zip
Fixing various compiler issues (#807)
Compile fixes for various versions of gcc,clang (non-UE)
Diffstat (limited to 'src/zencore/filesystem.cpp')
-rw-r--r--src/zencore/filesystem.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp
index 9885b2ada..8ed63565c 100644
--- a/src/zencore/filesystem.cpp
+++ b/src/zencore/filesystem.cpp
@@ -194,7 +194,7 @@ WipeDirectory(const wchar_t* DirPath, bool KeepDotFiles)
FindClose(hFind);
}
- return true;
+ return Success;
}
bool
@@ -1022,7 +1022,7 @@ TryCloneFile(const std::filesystem::path& FromPath, const std::filesystem::path&
return false;
}
fchmod(ToFd, 0666);
- ScopedFd $To = { FromFd };
+ ScopedFd $To = { ToFd };
ioctl(ToFd, FICLONE, FromFd);
@@ -1112,7 +1112,8 @@ CopyFile(const std::filesystem::path& FromPath, const std::filesystem::path& ToP
size_t FileSizeBytes = Stat.st_size;
- fchown(ToFd, Stat.st_uid, Stat.st_gid);
+ int $Ignore = fchown(ToFd, Stat.st_uid, Stat.st_gid);
+ ZEN_UNUSED($Ignore); // What's the appropriate error handling here?
// Copy impl
const size_t BufferSize = Min(FileSizeBytes, 64u << 10);
@@ -1398,7 +1399,7 @@ WriteFile(std::filesystem::path Path, const IoBuffer* const* Data, size_t Buffer
const uint64_t ChunkSize = Min<uint64_t>(WriteSize, uint64_t(2) * 1024 * 1024 * 1024);
#if ZEN_PLATFORM_WINDOWS
- hRes = Outfile.Write(DataPtr, gsl::narrow_cast<uint32_t>(WriteSize));
+ hRes = Outfile.Write(DataPtr, gsl::narrow_cast<uint32_t>(ChunkSize));
if (FAILED(hRes))
{
Outfile.Close();
@@ -1407,7 +1408,7 @@ WriteFile(std::filesystem::path Path, const IoBuffer* const* Data, size_t Buffer
ThrowSystemException(hRes, fmt::format("File write failed for '{}'", Path).c_str());
}
#else
- if (write(Fd, DataPtr, WriteSize) != int64_t(WriteSize))
+ if (write(Fd, DataPtr, ChunkSize) != int64_t(ChunkSize))
{
close(Fd);
std::error_code DummyEc;