aboutsummaryrefslogtreecommitdiff
path: root/zencore
diff options
context:
space:
mode:
Diffstat (limited to 'zencore')
-rw-r--r--zencore/filesystem.cpp8
-rw-r--r--zencore/thread.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp
index 7cd71e4b4..79563190c 100644
--- a/zencore/filesystem.cpp
+++ b/zencore/filesystem.cpp
@@ -436,7 +436,7 @@ CloneFile(std::filesystem::path FromPath, std::filesystem::path ToPath)
ScopedFd $From = { FromFd };
// The 'to' file
- int ToFd = open(ToPath.c_str(), O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC);
+ int ToFd = open(ToPath.c_str(), O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0666);
if (ToFd < 0)
{
return false;
@@ -503,7 +503,7 @@ CopyFile(std::filesystem::path FromPath, std::filesystem::path ToPath, const Cop
ScopedFd $From = {FromFd};
// To file
- int ToFd = open(ToPath.c_str(), O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC);
+ int ToFd = open(ToPath.c_str(), O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, 0666);
if (ToFd < 0)
{
ThrowLastError(fmt::format("failed to create file {}", ToPath));
@@ -560,11 +560,11 @@ WriteFile(std::filesystem::path Path, const IoBuffer* const* Data, size_t Buffer
#else
int OpenFlags = O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC;
- int Fd = open(Path.c_str(), OpenFlags);
+ int Fd = open(Path.c_str(), OpenFlags, 0666);
if (Fd < 0)
{
zen::CreateDirectories(Path.parent_path());
- Fd = open(Path.c_str(), OpenFlags);
+ Fd = open(Path.c_str(), OpenFlags, 0666);
}
if (Fd < 0)
diff --git a/zencore/thread.cpp b/zencore/thread.cpp
index df8cb7a34..527938cf3 100644
--- a/zencore/thread.cpp
+++ b/zencore/thread.cpp
@@ -271,7 +271,7 @@ NamedEvent::NamedEvent(std::string_view EventName)
ExtendableStringBuilder<64> EventPath;
EventPath << "/tmp/" << EventName;
- int Fd = open(EventPath.c_str(), O_RDWR | O_CREAT | O_CLOEXEC);
+ int Fd = open(EventPath.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0666);
if (Fd < 0)
{
ThrowLastError(fmt::format("Failed to create '{}' for named event", EventPath));
@@ -448,7 +448,7 @@ NamedMutex::Create(std::string_view MutexName)
ExtendableStringBuilder<64> Name;
Name << "/tmp/" << MutexName;
- int Inner = open(Name.c_str(), O_RDWR | O_CREAT | O_CLOEXEC);
+ int Inner = open(Name.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0666);
if (Inner < 0)
{
return false;