mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-01 12:26:34 -05:00
Auto-commit fs_open_fd.cpp
This commit is contained in:
parent
925b9eed9f
commit
ee753f28ca
1 changed files with 2 additions and 4 deletions
|
|
@ -28,14 +28,12 @@ int
|
||||||
fs::open_fd(const int fd_,
|
fs::open_fd(const int fd_,
|
||||||
const int flags_)
|
const int flags_)
|
||||||
{
|
{
|
||||||
const int proc_fd = procfs::PROC_SELF_FD_FD.load();
|
if(procfs::PROC_SELF_FD_FD <= 0)
|
||||||
|
|
||||||
if(proc_fd <= 0)
|
|
||||||
fatal::abort("procfs::PROC_SELF_FD_FD must be > 0");
|
fatal::abort("procfs::PROC_SELF_FD_FD must be > 0");
|
||||||
|
|
||||||
const int flags = (flags_ & ~O_NOFOLLOW);
|
const int flags = (flags_ & ~O_NOFOLLOW);
|
||||||
|
|
||||||
return fs::openat(proc_fd,
|
return fs::openat(procfs::PROC_SELF_FD_FD,
|
||||||
fmt::format("{}",fd_),
|
fmt::format("{}",fd_),
|
||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue