From abd39c6743ca482592bea5af2b5f6de423a3a2e0 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sat, 20 Feb 2016 14:57:06 -0500 Subject: Ensure Create passes correct flags to emulate creat(2) --- src/operations.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/operations.cc b/src/operations.cc index c6b5d79..010a1ee 100644 --- a/src/operations.cc +++ b/src/operations.cc @@ -129,7 +129,9 @@ int Create(const char* const path, const mode_t mode, return -EEXIST; } - return OpenResource(path, file_info->flags, mode, &file_info->fh); + return OpenResource(path, + file_info->flags | O_CREAT | O_WRONLY | O_EXCL, + mode, &file_info->fh); } catch (const std::system_error& e) { return -e.code().value(); } catch (...) { -- cgit v1.2.3