mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibCore: Use accept instead of accept4 on Haiku
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 16:51:33 +09:00
Author: https://github.com/ghost Commit: https://github.com/SerenityOS/serenity/commit/0816bbe7270 Pull-request: https://github.com/SerenityOS/serenity/pull/20808 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/diversys
@@ -80,7 +80,7 @@ ErrorOr<NonnullOwnPtr<TCPSocket>> TCPServer::accept()
|
||||
VERIFY(m_listening);
|
||||
sockaddr_in in;
|
||||
socklen_t in_size = sizeof(in);
|
||||
#ifndef AK_OS_MACOS
|
||||
#if !defined(AK_OS_MACOS) && !defined(AK_OS_HAIKU)
|
||||
int accepted_fd = TRY(Core::System::accept4(m_fd, (sockaddr*)&in, &in_size, SOCK_NONBLOCK | SOCK_CLOEXEC));
|
||||
#else
|
||||
int accepted_fd = TRY(Core::System::accept(m_fd, (sockaddr*)&in, &in_size));
|
||||
@@ -88,7 +88,7 @@ ErrorOr<NonnullOwnPtr<TCPSocket>> TCPServer::accept()
|
||||
|
||||
auto socket = TRY(TCPSocket::adopt_fd(accepted_fd));
|
||||
|
||||
#ifdef AK_OS_MACOS
|
||||
#if defined(AK_OS_MACOS) || defined(AK_OS_HAIKU)
|
||||
// FIXME: Ideally, we should let the caller decide whether it wants the
|
||||
// socket to be nonblocking or not, but there are currently places
|
||||
// which depend on this.
|
||||
|
||||
Reference in New Issue
Block a user