mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
Removing rudimental n1 variable
There is no real need in n1, since it used in only at one place once. Also it will prevent "variable ‘n1’ set but not used [-Werror=unused-but-set-variable]" error on build with -DLWS_MAX_SMP=N, where N > 1. AG: also add LWS_MAP_SMP != 1 test to travis to catch this kind of thing sooner
This commit is contained in:
parent
4c5138eade
commit
3459d4fe43
2 changed files with 3 additions and 6 deletions
|
@ -15,6 +15,7 @@ env:
|
|||
- LWS_METHOD=nodaemon CMAKE_ARGS="-DLWS_WITHOUT_DAEMONIZE=ON"
|
||||
- LWS_METHOD=cgi CMAKE_ARGS="-DLWS_WITH_CGI=ON"
|
||||
- LWS_METHOD=nologs CMAKE_ARGS="-DLWS_WITH_NO_LOGS=ON"
|
||||
- LWS_METHOD=smp CMAKE_ARGS="-DLWS_MAX_SMP=32 -DLWS_WITH_MINIMAL_EXAMPLES=1"
|
||||
|
||||
os:
|
||||
- linux
|
||||
|
|
|
@ -39,9 +39,6 @@ lws_context_init_server(struct lws_context_creation_info *info,
|
|||
struct lws_vhost *vhost)
|
||||
{
|
||||
int n, opt = 1, limit = 1;
|
||||
#if defined(__linux__) && defined(SO_REUSEPORT)
|
||||
int n1;
|
||||
#endif
|
||||
lws_sockfd_type sockfd;
|
||||
struct lws_vhost *vh;
|
||||
struct lws *wsi;
|
||||
|
@ -197,13 +194,12 @@ done_list:
|
|||
#endif
|
||||
|
||||
#if defined(__linux__) && defined(SO_REUSEPORT)
|
||||
n1 = lws_check_opt(vhost->options,
|
||||
LWS_SERVER_OPTION_ALLOW_LISTEN_SHARE);
|
||||
/* keep coverity happy */
|
||||
#if LWS_MAX_SMP > 1
|
||||
n = 1;
|
||||
#else
|
||||
n = n1;
|
||||
n = lws_check_opt(vhost->options,
|
||||
LWS_SERVER_OPTION_ALLOW_LISTEN_SHARE);
|
||||
#endif
|
||||
if (n && vhost->context->count_threads > 1)
|
||||
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT,
|
||||
|
|
Loading…
Add table
Reference in a new issue