summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibIPC/Decoder.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-14 09:31:21 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-14 09:50:14 +0100
commit7f2d8e88841bd1daf5583e24be4efb2946fc8402 (patch)
tree65313cbc24025bfbfd70f4d71d4421018322f345 /Userland/Libraries/LibIPC/Decoder.cpp
parent384d047e3e6d7004cd205c8262c31fe25785d54d (diff)
downloadserenity-7f2d8e88841bd1daf5583e24be4efb2946fc8402.zip
LibIPC: Close received IPC::File fd's by default unless taken
When receiving a file descriptor over IPC, the receiver must now call take_fd() on the IPC::File to take over the descriptor. Otherwise, IPC::File will close the file on destruction.
Diffstat (limited to 'Userland/Libraries/LibIPC/Decoder.cpp')
-rw-r--r--Userland/Libraries/LibIPC/Decoder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibIPC/Decoder.cpp b/Userland/Libraries/LibIPC/Decoder.cpp
index ff980bdaa5..96871f0b5b 100644
--- a/Userland/Libraries/LibIPC/Decoder.cpp
+++ b/Userland/Libraries/LibIPC/Decoder.cpp
@@ -174,7 +174,7 @@ bool Decoder::decode([[maybe_unused]] File& file)
dbgln("recvfd: {}", strerror(errno));
return false;
}
- file = File(fd);
+ file = File(fd, File::ConstructWithReceivedFileDescriptor);
return true;
#else
[[maybe_unused]] auto fd = m_sockfd;