diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2016-02-20 14:57:06 -0500 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2016-02-20 14:57:06 -0500 |
commit | abd39c6743ca482592bea5af2b5f6de423a3a2e0 (patch) | |
tree | e27740a3ab658923e0f3922d70bae01e8c886adf | |
parent | 11aa2411125aa38f018dfd2ee7f6a81cb3695511 (diff) |
Ensure Create passes correct flags to emulate creat(2)
-rw-r--r-- | src/operations.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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<File>(path, file_info->flags, mode, &file_info->fh); + return OpenResource<File>(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 (...) { |