fix: logger
This commit is contained in:
parent
61e025343d
commit
db3bcaf7d1
28 changed files with 200 additions and 180 deletions
helpers
|
@ -3,6 +3,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <logger.h>
|
||||
|
@ -25,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", gai_strerror(status));
|
||||
LOG_ERROR("getaddrinfo: %s\n", gai_strerror(status));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -33,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", strerror(errno));
|
||||
LOG_ERROR("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", strerror(errno));
|
||||
LOG_ERROR("error setting up listener: %s\n", strerror(errno));
|
||||
freeaddrinfo(res);
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue