mirror of
https://github.com/matrix-construct/construct
synced 2024-06-25 21:38:18 +02:00
ircd::fs: Add fd::opts nocreate open() option.
This commit is contained in:
parent
8395a7844c
commit
45155d5e4d
|
@ -49,6 +49,7 @@ struct ircd::fs::fd::opts
|
|||
bool ate {false};
|
||||
bool direct {false};
|
||||
bool cloexec {true};
|
||||
bool nocreate {false};
|
||||
|
||||
opts(const std::ios::open_mode &);
|
||||
opts() = default;
|
||||
|
|
|
@ -388,6 +388,7 @@ ircd::fs::fd::fd(const string_view &path,
|
|||
int flags(opts.flags);
|
||||
flags |= opts.direct? O_DIRECT : 0U;
|
||||
flags |= opts.cloexec? O_CLOEXEC : 0U;
|
||||
flags &= opts.nocreate? ~O_CREAT : flags;
|
||||
|
||||
const mode_t &mode(opts.mask);
|
||||
const char *const &p(path_str(path));
|
||||
|
|
Loading…
Reference in a new issue