aboutsummaryrefslogtreecommitdiff
path: root/zencore/filesystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zencore/filesystem.cpp')
-rw-r--r--zencore/filesystem.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp
index 73ba4ce1a..ca8d32b6b 100644
--- a/zencore/filesystem.cpp
+++ b/zencore/filesystem.cpp
@@ -545,7 +545,7 @@ WriteFile(std::filesystem::path Path, const IoBuffer* const* Data, size_t Buffer
}
#else
- int OpenFlags = O_WRONLY|O_CREAT|O_TRUNC;
+ int OpenFlags = O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC;
int Fd = open(Path.c_str(), OpenFlags, 0666);
if (Fd < 0)
{
@@ -641,7 +641,7 @@ ReadFile(std::filesystem::path Path)
FileSizeBytes = FileSize.EndOfFile.QuadPart;
Handle = FromFile.Detach();
#else
- int Fd = open(Path.c_str(), O_RDONLY);
+ int Fd = open(Path.c_str(), O_RDONLY|O_CLOEXEC);
if (Fd < 0)
{
FileContents Ret;