mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
LibCore: UDPServer::bind: Replace bind failure assert() with perror()
This commit is contained in:
parent
fe88f46bc9
commit
27a5c51f3f
1 changed files with 5 additions and 3 deletions
|
@ -62,12 +62,14 @@ bool UDPServer::bind(const IPv4Address& address, u16 port)
|
|||
if (m_bound)
|
||||
return false;
|
||||
|
||||
int rc;
|
||||
auto saddr = SocketAddress(address, port);
|
||||
auto in = saddr.to_sockaddr_in();
|
||||
|
||||
rc = ::bind(m_fd, (const sockaddr*)&in, sizeof(in));
|
||||
ASSERT(rc == 0);
|
||||
if (::bind(m_fd, (const sockaddr*)&in, sizeof(in)) != 0) {
|
||||
perror("UDPServer::bind");
|
||||
return false;
|
||||
}
|
||||
|
||||
m_bound = true;
|
||||
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Event::Read, this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue