mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 06:40:05 +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:
parent
09b1b09c19
commit
781d29a337
Notes:
sideshowbarker
2024-07-18 22:20:19 +09:00
Author: https://github.com/awesomekling
Commit: 781d29a337
7 changed files with 15 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue