Commit 760511ec authored by Sergey Lyubka's avatar Sergey Lyubka

squashed warning around NS_STACK_SIZE

parent 203688a3
......@@ -147,6 +147,8 @@ union socket_address {
struct sockaddr_in sin;
#ifdef NS_ENABLE_IPV6
struct sockaddr_in6 sin6;
#else
struct sockaddr sin6;
#endif
};
......@@ -338,7 +340,7 @@ void *ns_start_thread(void *(*f)(void *), void *p) {
(void) pthread_attr_init(&attr);
(void) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
#if NS_STACK_SIZE > 1
#if defined(NS_STACK_SIZE) && NS_STACK_SIZE > 1
(void) pthread_attr_setstacksize(&attr, NS_STACK_SIZE);
#endif
......@@ -557,7 +559,7 @@ static sock_t ns_open_listening_socket(union socket_address *sa) {
!setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &on, sizeof(on)) &&
#endif
!bind(sock, &sa->sa, sa->sa.sa_family == AF_INET ?
sizeof(sa->sin) : sizeof(sa->sa)) &&
sizeof(sa->sin) : sizeof(sa->sin6)) &&
!listen(sock, SOMAXCONN)) {
ns_set_non_blocking_mode(sock);
// In case port was set to 0, get the real port number
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment