diff options
Diffstat (limited to 'zenstore/filecas.cpp')
| -rw-r--r-- | zenstore/filecas.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp index f2f4465cc..5c7edef29 100644 --- a/zenstore/filecas.cpp +++ b/zenstore/filecas.cpp @@ -388,7 +388,14 @@ FileCasStrategy::InsertChunk(const void* const ChunkData, const size_t ChunkSize } #else // Attempt to exclusively create the file. - auto InternalCreateFile = [&] { return open(Name.ShardedPath.c_str(), O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, 0666); }; + auto InternalCreateFile = [&] { + int Fd = open(Name.ShardedPath.c_str(), O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC); + if (Fd >= 0) + { + fchmod(Fd, 0666); + } + return Fd; + }; int Fd = InternalCreateFile(); if (Fd < 0) { |