diff options
| author | Martin Ridgers <[email protected]> | 2022-02-21 13:28:40 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2022-02-21 13:28:40 +0100 |
| commit | 9910aa2db475c47ff97f4239e2393a940663685f (patch) | |
| tree | defc14379d3f7b1aefd0c893f0dcb0fcfd34f156 /zenstore/basicfile.cpp | |
| parent | Linux compile fix (diff) | |
| download | zen-9910aa2db475c47ff97f4239e2393a940663685f.tar.xz zen-9910aa2db475c47ff97f4239e2393a940663685f.zip | |
If open(O_CREAT) is used then a file mode must be given
Diffstat (limited to 'zenstore/basicfile.cpp')
| -rw-r--r-- | zenstore/basicfile.cpp | 4 |
1 files changed, 2 insertions, 2 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(); |