LibIPC: Remove platform-specific #ifdefs around FD passing in Connection

Let the LocalSocket class decide if FD passing is supported or not.
This commit is contained in:
Andreas Kling 2022-10-05 14:38:26 +02:00
parent 4d762fd3a6
commit 35966cabe4
Notes: sideshowbarker 2024-07-17 06:20:47 +09:00

View file

@ -48,17 +48,12 @@ ErrorOr<void> ConnectionBase::post_message(MessageBuffer buffer)
uint32_t message_size = buffer.data.size();
TRY(buffer.data.try_prepend(reinterpret_cast<u8 const*>(&message_size), sizeof(message_size)));
#ifdef __serenity__
for (auto& fd : buffer.fds) {
if (auto result = fd_passing_socket().send_fd(fd.value()); result.is_error()) {
shutdown_with_error(result.error());
return result;
}
}
#else
if (!buffer.fds.is_empty())
warnln("fd passing is not supported on this platform, sorry :(");
#endif
ReadonlyBytes bytes_to_write { buffer.data.span() };
int writes_done = 0;