mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-03 13:28:44 +00:00
squashed warning around NS_STACK_SIZE
This commit is contained in:
1 parent
203688a34b
commit
760511ec49
1 file changed
+4
-2
+4
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user