fix: logger

This commit is contained in:
Tobias Reisinger 2020-04-24 15:08:26 +02:00
parent 61e025343d
commit db3bcaf7d1
28 changed files with 200 additions and 180 deletions

View file

@ -25,7 +25,7 @@ helper_open_discovery_socket(uint16_t discovery_port)
//get connection info for our computer
if ((status = getaddrinfo(NULL, discovery_port_str, &hints, &res)) != 0)
{
LOG_FATAL("getaddrinfo: %s", gai_strerror(status));
LOG_FATAL("getaddrinfo: %s\n", gai_strerror(status));
freeaddrinfo(res);
exit(EXIT_FAILURE);
}
@ -37,21 +37,21 @@ helper_open_discovery_socket(uint16_t discovery_port)
// lose the pesky "Address already in use" error message
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) == -1)
{
LOG_FATAL("setsockopt: %s", strerror(errno));
LOG_FATAL("setsockopt: %s\n", strerror(errno));
freeaddrinfo(res);
exit(EXIT_FAILURE);
}
if (bind(fd, res->ai_addr, res->ai_addrlen) == -1)
{
LOG_FATAL("bind: %s", strerror(errno));
LOG_FATAL("bind: %s\n", strerror(errno));
freeaddrinfo(res);
exit(EXIT_FAILURE);
}
freeaddrinfo(res);
LOG_INFO("opened discovery socket on port %u", discovery_port);
LOG_INFO("opened discovery socket on port %u\n", discovery_port);
return fd;
}