mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:07:45 +00:00
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:
parent
4d762fd3a6
commit
35966cabe4
1 changed files with 0 additions and 5 deletions
|
@ -48,17 +48,12 @@ ErrorOr<void> ConnectionBase::post_message(MessageBuffer buffer)
|
||||||
uint32_t message_size = buffer.data.size();
|
uint32_t message_size = buffer.data.size();
|
||||||
TRY(buffer.data.try_prepend(reinterpret_cast<u8 const*>(&message_size), sizeof(message_size)));
|
TRY(buffer.data.try_prepend(reinterpret_cast<u8 const*>(&message_size), sizeof(message_size)));
|
||||||
|
|
||||||
#ifdef __serenity__
|
|
||||||
for (auto& fd : buffer.fds) {
|
for (auto& fd : buffer.fds) {
|
||||||
if (auto result = fd_passing_socket().send_fd(fd.value()); result.is_error()) {
|
if (auto result = fd_passing_socket().send_fd(fd.value()); result.is_error()) {
|
||||||
shutdown_with_error(result.error());
|
shutdown_with_error(result.error());
|
||||||
return result;
|
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() };
|
ReadonlyBytes bytes_to_write { buffer.data.span() };
|
||||||
int writes_done = 0;
|
int writes_done = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue