aboutsummaryrefslogtreecommitdiff
path: root/zenstore/basicfile.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-10-20 15:50:21 +0200
committerMartin Ridgers <[email protected]>2021-10-25 08:46:34 +0200
commit7728c367fdbcab816632c93e83ca3ef300a7ae1a (patch)
tree0783fec15a575d38c070dd8311151eea9b1e0258 /zenstore/basicfile.cpp
parentMade a note about a tick's unit and DateTime's epoch (diff)
downloadzen-7728c367fdbcab816632c93e83ca3ef300a7ae1a.tar.xz
zen-7728c367fdbcab816632c93e83ca3ef300a7ae1a.zip
open() flags were incorrect and it would not create new files
Diffstat (limited to 'zenstore/basicfile.cpp')
-rw-r--r--zenstore/basicfile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/zenstore/basicfile.cpp b/zenstore/basicfile.cpp
index dd3598319..a1b9109b3 100644
--- a/zenstore/basicfile.cpp
+++ b/zenstore/basicfile.cpp
@@ -74,7 +74,7 @@ BasicFile::Open(std::filesystem::path FileName, bool IsCreate, std::error_code&
int OpenFlags = O_RDWR;
OpenFlags |= IsCreate ? O_CREAT|O_TRUNC : 0;
- int Fd = open(FileName.c_str(), O_RDWR, 0666);
+ int Fd = open(FileName.c_str(), OpenFlags, 0666);
if (Fd < 0)
{
Ec = zen::MakeErrorCodeFromLastError();