1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

Kernel+Userland: Give sys$recvfd() an options argument for O_CLOEXEC

@bugaevc pointed out that we shouldn't be setting this flag in
userspace, and he's right of course.
This commit is contained in:
Andreas Kling 2021-02-14 10:38:22 +01:00
parent 09b1b09c19
commit 781d29a337
7 changed files with 15 additions and 15 deletions

View file

@ -171,15 +171,11 @@ bool Decoder::decode(Dictionary& dictionary)
bool Decoder::decode([[maybe_unused]] File& file)
{
#ifdef __serenity__
int fd = recvfd(m_sockfd);
int fd = recvfd(m_sockfd, O_CLOEXEC);
if (fd < 0) {
dbgln("recvfd: {}", strerror(errno));
return false;
}
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
dbgln("fcntl(F_SETFD, FD_CLOEXEC): {}", strerror(errno));
return false;
}
file = File(fd, File::ConstructWithReceivedFileDescriptor);
return true;
#else