Auto-commit fs_open_fd.cpp

This commit is contained in:
Antonio SJ Musumeci 2026-04-14 21:37:13 -05:00
parent b8f8e9ddc9
commit 0e541552b0

View file

@ -28,7 +28,9 @@ int
fs::open_fd(const int fd_,
const int flags_)
{
if(procfs::PROC_SELF_FD_FD <= 0)
const int proc_fd = procfs::PROC_SELF_FD_FD.load();
if(proc_fd <= 0)
fatal::abort("procfs::PROC_SELF_FD_FD must be > 0");
const int flags = (flags_ & ~O_NOFOLLOW);