diff options
Diffstat (limited to 'zenstore')
| -rw-r--r-- | zenstore/basicfile.cpp | 4 | ||||
| -rw-r--r-- | zenstore/filecas.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/zenstore/basicfile.cpp b/zenstore/basicfile.cpp index 1b6080379..895db6cee 100644 --- a/zenstore/basicfile.cpp +++ b/zenstore/basicfile.cpp @@ -75,7 +75,7 @@ BasicFile::Open(std::filesystem::path FileName, bool IsCreate, std::error_code& int OpenFlags = O_RDWR | O_CLOEXEC; OpenFlags |= IsCreate ? O_CREAT | O_TRUNC : 0; - int Fd = open(FileName.c_str(), OpenFlags); + int Fd = open(FileName.c_str(), OpenFlags, 0666); if (Fd < 0) { Ec = zen::MakeErrorCodeFromLastError(); @@ -370,7 +370,7 @@ LockFile::Create(std::filesystem::path FileName, CbObject Payload, std::error_co return; } #elif ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC - int Fd = open(FileName.c_str(), O_RDWR | O_CREAT | O_CLOEXEC); + int Fd = open(FileName.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0666); if (Fd < 0) { Ec = zen::MakeErrorCodeFromLastError(); diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp index 5c7edef29..758c0665b 100644 --- a/zenstore/filecas.cpp +++ b/zenstore/filecas.cpp @@ -389,7 +389,7 @@ FileCasStrategy::InsertChunk(const void* const ChunkData, const size_t ChunkSize #else // Attempt to exclusively create the file. auto InternalCreateFile = [&] { - int Fd = open(Name.ShardedPath.c_str(), O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC); + int Fd = open(Name.ShardedPath.c_str(), O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, 0666); if (Fd >= 0) { fchmod(Fd, 0666); |