mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibCore: UDPServer::bind: Replace bind failure assert() with perror()
This commit is contained in:
committed by
Andreas Kling
parent
fe88f46bc9
commit
27a5c51f3f
@@ -62,12 +62,14 @@ bool UDPServer::bind(const IPv4Address& address, u16 port)
|
|||||||
if (m_bound)
|
if (m_bound)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int rc;
|
|
||||||
auto saddr = SocketAddress(address, port);
|
auto saddr = SocketAddress(address, port);
|
||||||
auto in = saddr.to_sockaddr_in();
|
auto in = saddr.to_sockaddr_in();
|
||||||
|
|
||||||
rc = ::bind(m_fd, (const sockaddr*)&in, sizeof(in));
|
if (::bind(m_fd, (const sockaddr*)&in, sizeof(in)) != 0) {
|
||||||
ASSERT(rc == 0);
|
perror("UDPServer::bind");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
m_bound = true;
|
m_bound = true;
|
||||||
|
|
||||||
m_notifier = Notifier::construct(m_fd, Notifier::Event::Read, this);
|
m_notifier = Notifier::construct(m_fd, Notifier::Event::Read, this);
|
||||||
|
|||||||
Reference in New Issue
Block a user