libc: Set the close-on-exec flag for directories opened using opendir()

This is apparently mandated by POSIX.
This commit is contained in:
apio 2023-07-31 10:58:06 +02:00
parent 3598dacbed
commit d01087362e
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -20,6 +20,8 @@ extern "C"
return nullptr;
}
fcntl(fd, F_SETFD, FD_CLOEXEC);
dp->_fd = fd;
return dp;