fix: better logging behaviour
This commit is contained in:
parent
011c5a6102
commit
0530a350df
30 changed files with 343 additions and 176 deletions
src/helpers
|
@ -26,7 +26,7 @@ helper_bind_tcp_server(char* addr, uint16_t port, int max_client_backlog)
|
|||
|
||||
if ((status = getaddrinfo(addr, port_str, &hints, &res)) != 0)
|
||||
{
|
||||
LOG_ERROR("getaddrinfo: %s\n", gai_strerror(status));
|
||||
LOGGER_ERR("getaddrinfo: %s\n", gai_strerror(status));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -34,14 +34,14 @@ helper_bind_tcp_server(char* addr, uint16_t port, int max_client_backlog)
|
|||
|
||||
if ((status = bind(fd, res->ai_addr, res->ai_addrlen)) == -1)
|
||||
{
|
||||
LOG_ERROR("error binding socket: %s\n", strerror(errno));
|
||||
LOGGER_ERR("error binding socket: %s\n", strerror(errno));
|
||||
freeaddrinfo(res);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((status = listen(fd, max_client_backlog)) == -1)
|
||||
{
|
||||
LOG_ERROR("error setting up listener: %s\n", strerror(errno));
|
||||
LOGGER_ERR("error setting up listener: %s\n", strerror(errno));
|
||||
freeaddrinfo(res);
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue