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

LibIPC: Make sure FDs survive when passed into a MessageBuffer

This commit is contained in:
Gunnar Beutner 2021-05-02 12:28:20 +02:00 committed by Andreas Kling
parent cc6db526a6
commit de9b454f89
3 changed files with 34 additions and 4 deletions

View file

@ -65,8 +65,8 @@ public:
buffer.data.prepend(reinterpret_cast<const u8*>(&message_size), sizeof(message_size));
#ifdef __serenity__
for (int fd : buffer.fds) {
auto rc = sendfd(m_socket->fd(), fd);
for (auto& fd : buffer.fds) {
auto rc = sendfd(m_socket->fd(), fd->value());
if (rc < 0) {
perror("sendfd");
shutdown();