mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd::fs: Rename nocreate to create in fd::opts.
This commit is contained in:
parent
a509334c2d
commit
95cb3df160
2 changed files with 5 additions and 5 deletions
|
@ -77,9 +77,9 @@ struct ircd::fs::fd::opts
|
|||
/// (O_CLOEXEC) Close this descriptor on an exec().
|
||||
bool cloexec {true};
|
||||
|
||||
/// Prevents file from being created if it doesn't exist. This clears
|
||||
/// any implied O_CREAT from the open_mode ctor and in flags too.
|
||||
bool nocreate {false};
|
||||
/// Allows file to be created if it doesn't exist. Set this to false to
|
||||
/// prevent file from being created when opened with a write-mode.
|
||||
bool create {true};
|
||||
|
||||
/// Advise for random access (ignored when direct=true)
|
||||
bool random {false};
|
||||
|
|
|
@ -2380,7 +2380,7 @@ const
|
|||
|
||||
ret.direct = ret.flags & O_DIRECT;
|
||||
ret.cloexec = ret.flags & O_CLOEXEC;
|
||||
ret.nocreate = ~ret.flags & O_CREAT;
|
||||
ret.create = ret.flags & O_CREAT;
|
||||
ret.blocking = ret.flags & O_NONBLOCK;
|
||||
return ret;
|
||||
}
|
||||
|
@ -2392,7 +2392,7 @@ ircd::fs::flags(const fd::opts &opts)
|
|||
ret |= fs::flags(opts.mode);
|
||||
ret |= opts.direct? O_DIRECT : 0UL;
|
||||
ret |= opts.cloexec? O_CLOEXEC : 0UL;
|
||||
ret &= opts.nocreate? ~O_CREAT : ret;
|
||||
ret |= opts.create? O_CREAT : 0UL;
|
||||
ret |= !opts.blocking? O_NONBLOCK : 0UL;
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue