Auto-commit fs_open_fd.cpp

This commit is contained in:
Antonio SJ Musumeci 2026-04-14 21:54:55 -05:00
parent 925b9eed9f
commit ee753f28ca

View file

@ -28,14 +28,12 @@ int
fs::open_fd(const int fd_,
const int flags_)
{
const int proc_fd = procfs::PROC_SELF_FD_FD.load();
if(proc_fd <= 0)
if(procfs::PROC_SELF_FD_FD <= 0)
fatal::abort("procfs::PROC_SELF_FD_FD must be > 0");
const int flags = (flags_ & ~O_NOFOLLOW);
return fs::openat(proc_fd,
return fs::openat(procfs::PROC_SELF_FD_FD,
fmt::format("{}",fd_),
flags);
}