diff options
author | Andreas Kling <kling@serenityos.org> | 2021-01-14 09:31:21 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-14 09:50:14 +0100 |
commit | 7f2d8e88841bd1daf5583e24be4efb2946fc8402 (patch) | |
tree | 65313cbc24025bfbfd70f4d71d4421018322f345 /Userland/Libraries/LibIPC/Decoder.cpp | |
parent | 384d047e3e6d7004cd205c8262c31fe25785d54d (diff) | |
download | serenity-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.cpp | 2 |
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; |