From 7f2d8e88841bd1daf5583e24be4efb2946fc8402 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 14 Jan 2021 09:31:21 +0100 Subject: 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. --- Userland/Libraries/LibIPC/Decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Libraries/LibIPC/Decoder.cpp') 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; -- cgit v1.2.3